max_stars_repo_path stringlengths 4 286 | max_stars_repo_name stringlengths 5 119 | max_stars_count int64 0 191k | id stringlengths 1 7 | content stringlengths 6 1.03M | content_cleaned stringlengths 6 1.03M | language stringclasses 111
values | language_score float64 0.03 1 | comments stringlengths 0 556k | edu_score float64 0.32 5.03 | edu_int_score int64 0 5 |
|---|---|---|---|---|---|---|---|---|---|---|
Simple_Use_Of_Random/Simple_Use_Of_Random.py | GracjanBuczek/Python | 0 | 6633251 | import random
#part 1 - Pseudorandom number generator
for n in range (0,10):
n = random.randint(1,100)
print(n)
input("\nPress any key to continue...\n")
#part 2 - Comapring x&y, counter
number1 = random.randint(1,100)
number2 = random.randint(1,100)
counter = 1
while number2!=number1:
print('Value of num... | import random
#part 1 - Pseudorandom number generator
for n in range (0,10):
n = random.randint(1,100)
print(n)
input("\nPress any key to continue...\n")
#part 2 - Comapring x&y, counter
number1 = random.randint(1,100)
number2 = random.randint(1,100)
counter = 1
while number2!=number1:
print('Value of num... | en | 0.217005 | #part 1 - Pseudorandom number generator #part 2 - Comapring x&y, counter | 3.823096 | 4 |
matchups/tests/test.py | MattHJensen/Matchups | 0 | 6633252 | <reponame>MattHJensen/Matchups<gh_stars>0
from matchups import matchups
def test_get_inputs():
assert matchups.get_inputs()
def test_parse_inputs():
adj = {"matchup": {"batter": ["<NAME>"]}}
ew = {"matchup": {"errors": {}, "warnings": {}}}
r = matchups.parse_inputs(adj, "", ew, True)
assert r
def... | from matchups import matchups
def test_get_inputs():
assert matchups.get_inputs()
def test_parse_inputs():
adj = {"matchup": {"batter": ["<NAME>"]}}
ew = {"matchup": {"errors": {}, "warnings": {}}}
r = matchups.parse_inputs(adj, "", ew, True)
assert r
def test_get_matchup():
use_2018 = True
... | none | 1 | 2.798751 | 3 | |
pkg/win32/mod_tools/exported/validate.py | victorpopkov/ds-mod-tools | 1 | 6633253 | <gh_stars>1-10
import glob
import sys
import xml.etree.ElementTree as ET
import zipfile
from collections import defaultdict
from clint.textui import progress
anim_map = defaultdict(list)
for zipfilename in progress.bar(glob.glob("*.zip")):
try:
with zipfile.ZipFile(zipfilename, "r") as zf:
ro... | import glob
import sys
import xml.etree.ElementTree as ET
import zipfile
from collections import defaultdict
from clint.textui import progress
anim_map = defaultdict(list)
for zipfilename in progress.bar(glob.glob("*.zip")):
try:
with zipfile.ZipFile(zipfilename, "r") as zf:
root = ET.fromstr... | none | 1 | 2.633278 | 3 | |
parse_corpus.py | crscardellino/sbwce | 30 | 6633254 | <reponame>crscardellino/sbwce
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import fnmatch
import os
import re
import sys
import spacy
from tqdm import tqdm
spacy.prefer_gpu()
nlp = spacy.load("es", disable=['parser', 'ner'])
def traverse_dir... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import fnmatch
import os
import re
import sys
import spacy
from tqdm import tqdm
spacy.prefer_gpu()
nlp = spacy.load("es", disable=['parser', 'ner'])
def traverse_directory(path, file_pattern='*')... | en | 0.352855 | #!/usr/bin/env python # -*- coding: utf-8 -*- | 2.625909 | 3 |
Lib/site-packages/deriva/transfer/restore/deriva_restore.py | fochoao/cpython | 3 | 6633255 | import io
import os
import sys
import copy
import json
import time
import logging
import datetime
import platform
from collections import OrderedDict
from bdbag import bdbag_api as bdb
from deriva.core import get_credential, format_credential, urlquote, format_exception, DEFAULT_SESSION_CONFIG, \
__version__ as VER... | import io
import os
import sys
import copy
import json
import time
import logging
import datetime
import platform
from collections import OrderedDict
from bdbag import bdbag_api as bdb
from deriva.core import get_credential, format_credential, urlquote, format_exception, DEFAULT_SESSION_CONFIG, \
__version__ as VER... | en | 0.822026 | Restore a DERIVA catalog from a bag archive or directory. Core restore logic re-purposed from ErmrestCatalog.clone_catalog(). # server variable initialization # credential initialization # destination catalog initialization # process config file Copy schema definition structure with conditional parts for cloning. C... | 1.780758 | 2 |
tests/conftest.py | graingert/django-data-browser | 0 | 6633256 | <reponame>graingert/django-data-browser<filename>tests/conftest.py<gh_stars>0
import dj_database_url
import django
import pytest
from django.conf import settings
DATABASE_CONFIG = dj_database_url.config(
conn_max_age=600, default="sqlite:///db.sqlite3"
)
POSTGRES = "postgresql" in DATABASE_CONFIG["ENGINE"]
SQLITE... | import dj_database_url
import django
import pytest
from django.conf import settings
DATABASE_CONFIG = dj_database_url.config(
conn_max_age=600, default="sqlite:///db.sqlite3"
)
POSTGRES = "postgresql" in DATABASE_CONFIG["ENGINE"]
SQLITE = "sqlite" in DATABASE_CONFIG["ENGINE"]
if POSTGRES:
JSON_FIELD_SUPPORT ... | en | 0.381751 | # pragma: no branch | 1.973679 | 2 |
pyladies_cz.py | jacekszymanski/pyladies.cz | 0 | 6633257 | #!/usr/bin/env python3
"""Create or serve the pyladies.cz website
"""
import sys
if sys.version_info < (3, 0):
raise RuntimeError('You need Python 3.')
import os
import fnmatch
import datetime
import collections
from urllib.parse import urlencode
from flask import Flask, render_template, url_for, send_from_dire... | #!/usr/bin/env python3
"""Create or serve the pyladies.cz website
"""
import sys
if sys.version_info < (3, 0):
raise RuntimeError('You need Python 3.')
import os
import fnmatch
import datetime
import collections
from urllib.parse import urlencode
from flask import Flask, render_template, url_for, send_from_dire... | en | 0.733018 | #!/usr/bin/env python3 Create or serve the pyladies.cz website Return a response with a Meta redirect # With static pages, we can't use HTTP redirects. # Return a page wit <meta refresh> instead. # # When Frozen-Flask gets support for redirects # (https://github.com/Frozen-Flask/Frozen-Flask/issues/81), # this should b... | 2.306531 | 2 |
captcha22/lib/server/captcha22.py | Hirza-Tango/captcha22 | 0 | 6633258 | <gh_stars>0
#!/usr/bin/python3
import numpy
import os
import time
import glob
import cv2
import ast
import argparse
class captcha:
def __init__(self, path):
self.path = path
self.hasTrained = False
self.busyTraining = False
self.hasModel = False
self.modelActive = False
... | #!/usr/bin/python3
import numpy
import os
import time
import glob
import cv2
import ast
import argparse
class captcha:
def __init__(self, path):
self.path = path
self.hasTrained = False
self.busyTraining = False
self.hasModel = False
self.modelActive = False
self.m... | en | 0.893527 | #!/usr/bin/python3 # Go read the aocr log # We need to combine two values, the current step and the last saved step. This gives us the total step. # Time to end # Sometime the kill is not respected. Do this three times to ensure it is killed # Creating folder structure data # Creating folder structure for model # Copy ... | 2.598917 | 3 |
app.py | AzisK/Desktop | 0 | 6633259 | import os
import fnmatch
import PySimpleGUI as sg
PATH = f"{os.environ['HOME']}/Desktop"
# DOCUMENTS_FOLDER = f"{PATH}/Documents"
# SCREENSHOTS_FOLDER = f"{PATH}/Screenshots"
# PICTURES_FOLDER = f"{PATH}/Pictures"
DOCUMENT = {
"name": "Documents",
"path": f"{PATH}/Documents",
"description": "document",
... | import os
import fnmatch
import PySimpleGUI as sg
PATH = f"{os.environ['HOME']}/Desktop"
# DOCUMENTS_FOLDER = f"{PATH}/Documents"
# SCREENSHOTS_FOLDER = f"{PATH}/Screenshots"
# PICTURES_FOLDER = f"{PATH}/Pictures"
DOCUMENT = {
"name": "Documents",
"path": f"{PATH}/Documents",
"description": "document",
... | en | 0.344249 | # DOCUMENTS_FOLDER = f"{PATH}/Documents" # SCREENSHOTS_FOLDER = f"{PATH}/Screenshots" # PICTURES_FOLDER = f"{PATH}/Pictures" | 3.046417 | 3 |
aidants_connect_web/migrations/0047_cartetotp.py | betagouv/Aidants_Connect | 16 | 6633260 | # Generated by Django 3.1.1 on 2021-02-15 15:19
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("aidants_connect_web", "0046_organisation_zipcode"),
]
operations = [
migrations.CreateModel(
name="CarteTOTP",
field... | # Generated by Django 3.1.1 on 2021-02-15 15:19
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("aidants_connect_web", "0046_organisation_zipcode"),
]
operations = [
migrations.CreateModel(
name="CarteTOTP",
field... | en | 0.725988 | # Generated by Django 3.1.1 on 2021-02-15 15:19 | 1.788873 | 2 |
dingtalk/python/alibabacloud_dingtalk/alitrip_1_0/models.py | aliyun/dingtalk-sdk | 15 | 6633261 | # -*- coding: utf-8 -*-
# This file is auto-generated, don't edit it. Thanks.
from Tea.model import TeaModel
from typing import Dict, List
class ApproveCityCarApplyHeaders(TeaModel):
def __init__(
self,
common_headers: Dict[str, str] = None,
x_acs_dingtalk_access_token: str = None,
):
... | # -*- coding: utf-8 -*-
# This file is auto-generated, don't edit it. Thanks.
from Tea.model import TeaModel
from typing import Dict, List
class ApproveCityCarApplyHeaders(TeaModel):
def __init__(
self,
common_headers: Dict[str, str] = None,
x_acs_dingtalk_access_token: str = None,
):
... | zh | 0.97566 | # -*- coding: utf-8 -*- # This file is auto-generated, don't edit it. Thanks. # 第三方企业ID # 审批时间 # 审批备注 # 审批结果:1-同意,2-拒绝 # 第三方审批单ID # 审批的第三方员工ID # suiteKey # account # tokenGrantType # 审批结果 # 第三方企业 # 类目:机酒火车 1:机票; 2:酒店; 4:用车 6:商旅火车票 # 每页数据量,默认100,最高500 # 记账更新开始日期 # 页数,从1开始 # 记账更新结束日期 # 交易流水号 # 审批单号 # 预定时间 # 预定人use id # 预... | 2.130276 | 2 |
discovery-provider/src/solana/solana_client_manager.py | Tenderize/audius-protocol | 0 | 6633262 | <filename>discovery-provider/src/solana/solana_client_manager.py
import logging
import random
import signal
import time
from contextlib import contextmanager
from typing import Optional, Union
from solana.account import Account
from solana.publickey import PublicKey
from solana.rpc.api import Client
from src.solana.so... | <filename>discovery-provider/src/solana/solana_client_manager.py
import logging
import random
import signal
import time
from contextlib import contextmanager
from typing import Optional, Union
from solana.account import Account
from solana.publickey import PublicKey
from solana.rpc.api import Client
from src.solana.so... | en | 0.8351 | # maximum number of times to retry get_confirmed_transaction call # number of seconds to wait between calls to get_confirmed_transaction Fetches a solana transaction by signature with retries and a delay. Fetches confirmed signatures for transactions given an address. # Register a function to raise a TimeoutError on th... | 2.344198 | 2 |
pysces/__init__.py | bgoli/pysces | 0 | 6633263 | <reponame>bgoli/pysces
"""
PySCeS - Python Simulator for Cellular Systems (http://pysces.sourceforge.net)
Copyright (C) 2004-2020 <NAME>, <NAME>, <NAME> all rights reserved,
<NAME> (<EMAIL>)
Triple-J Group for Molecular Cell Physiology
Stellenbosch University, South Africa.
Permission to use, modify, and distribute ... | """
PySCeS - Python Simulator for Cellular Systems (http://pysces.sourceforge.net)
Copyright (C) 2004-2020 <NAME>, <NAME>, <NAME> all rights reserved,
<NAME> (<EMAIL>)
Triple-J Group for Molecular Cell Physiology
Stellenbosch University, South Africa.
Permission to use, modify, and distribute this software is given ... | en | 0.74236 | PySCeS - Python Simulator for Cellular Systems (http://pysces.sourceforge.net) Copyright (C) 2004-2020 <NAME>, <NAME>, <NAME> all rights reserved, <NAME> (<EMAIL>) Triple-J Group for Molecular Cell Physiology Stellenbosch University, South Africa. Permission to use, modify, and distribute this software is given unde... | 1.888915 | 2 |
redash/handlers/alerts.py | jrbenny35/redash | 0 | 6633264 | import time
from flask import request
from funcy import project
from redash import models
from redash.handlers.base import (BaseResource, get_object_or_404,
require_fields)
from redash.permissions import (require_access, require_admin_or_owner,
require... | import time
from flask import request
from funcy import project
from redash import models
from redash.handlers.base import (BaseResource, get_object_or_404,
require_fields)
from redash.permissions import (require_access, require_admin_or_owner,
require... | none | 1 | 2.030812 | 2 | |
flare/kernels/mc_mb_sepcut.py | aaronchen0316/flare | 144 | 6633265 | """
Implementation of three-body kernels using different cutoffs.
The kernels are slightly slower.
"""
import numpy as np
import os
import sys
from numba import njit
from math import exp
import flare.kernels.cutoffs as cf
from flare.env import AtomicEnvironment
from flare.kernels.kernels import (
coordination_... | """
Implementation of three-body kernels using different cutoffs.
The kernels are slightly slower.
"""
import numpy as np
import os
import sys
from numba import njit
from math import exp
import flare.kernels.cutoffs as cf
from flare.env import AtomicEnvironment
from flare.kernels.kernels import (
coordination_... | en | 0.649289 | Implementation of three-body kernels using different cutoffs. The kernels are slightly slower. many-body multi-element kernel between two force components accelerated with Numba. Args: c1 (int): atomic species of the central atom in env 1 c2 (int): atomic species of the central atom in env 2 ... | 2.341058 | 2 |
bai07.py | trietto/python | 0 | 6633266 | <reponame>trietto/python
print (abs.__doc__)
print (int.__doc__)
print (input.__doc__)
# Code by <EMAIL>
def square(num):
'''Trả lại giá trị bình phương của số được nhập vào.
Số nhập vào phải là số nguyên.
'''
return num ** 2
print (square.__doc__) | print (abs.__doc__)
print (int.__doc__)
print (input.__doc__)
# Code by <EMAIL>
def square(num):
'''Trả lại giá trị bình phương của số được nhập vào.
Số nhập vào phải là số nguyên.
'''
return num ** 2
print (square.__doc__) | vi | 1.000069 | # Code by <EMAIL> Trả lại giá trị bình phương của số được nhập vào. Số nhập vào phải là số nguyên. | 2.945173 | 3 |
Python/pythonProject/exercise/ex051.py | JoaoMoreira2002/Linguagens-de-programacao | 0 | 6633267 | <filename>Python/pythonProject/exercise/ex051.py
print('Digite o primeiro termo, e a razão de uma PA')
x = int(input('Primeiro termo'))
y = int(input('Razão'))
for n in range(0, 11):
print('{}'.format(x + ((n - 0) * y)))
print('Esses são os 10 primeiros termos') | <filename>Python/pythonProject/exercise/ex051.py
print('Digite o primeiro termo, e a razão de uma PA')
x = int(input('Primeiro termo'))
y = int(input('Razão'))
for n in range(0, 11):
print('{}'.format(x + ((n - 0) * y)))
print('Esses são os 10 primeiros termos') | none | 1 | 3.981554 | 4 | |
animations/fur.py | TheSkorm/dc26-fur-scripts | 1 | 6633268 | <filename>animations/fur.py
"""Furry Face Simulator
Use: http://liquidthex.com/dcfursBadgePixelator/
Features:
* Will randomly blink every 10 - 20 seconds if no large-scale movements happen (winks)
* Will track eyes with small nudges in up / down, left / right tilts
* Will wink left/right if tilted too far
* W... | <filename>animations/fur.py
"""Furry Face Simulator
Use: http://liquidthex.com/dcfursBadgePixelator/
Features:
* Will randomly blink every 10 - 20 seconds if no large-scale movements happen (winks)
* Will track eyes with small nudges in up / down, left / right tilts
* Will wink left/right if tilted too far
* W... | en | 0.628668 | Furry Face Simulator Use: http://liquidthex.com/dcfursBadgePixelator/ Features: * Will randomly blink every 10 - 20 seconds if no large-scale movements happen (winks) * Will track eyes with small nudges in up / down, left / right tilts * Will wink left/right if tilted too far * Will close eyes if held upside d... | 2.705143 | 3 |
ppo/ppo/buffer.py | Gregory-Eales/ml-reimplementations | 1 | 6633269 | <filename>ppo/ppo/buffer.py<gh_stars>1-10
import torch
import numpy as np
class Buffer(object):
def __init__(self):
# store actions
self.action_buffer = []
# store old actions
self.old_action_buffer = []
# store state
self.observation_buffer = []
# store... | <filename>ppo/ppo/buffer.py<gh_stars>1-10
import torch
import numpy as np
class Buffer(object):
def __init__(self):
# store actions
self.action_buffer = []
# store old actions
self.old_action_buffer = []
# store state
self.observation_buffer = []
# store... | en | 0.825711 | # store actions # store old actions # store state # store reward # store advantage # store actions # store old actions # store state # store reward # store advantage | 2.304491 | 2 |
test_lock.py | bellahOchola/password-locker | 0 | 6633270 | import unittest
from password import *
class TestUser(unittest.TestCase):
'''
This is a test class that defines test cases
for user login and signup details.
Args:
unittest.TestCase: TestCase class aids in the formation of test cases
'''
def setUp(self):
'''
method to ... | import unittest
from password import *
class TestUser(unittest.TestCase):
'''
This is a test class that defines test cases
for user login and signup details.
Args:
unittest.TestCase: TestCase class aids in the formation of test cases
'''
def setUp(self):
'''
method to ... | en | 0.864584 | This is a test class that defines test cases for user login and signup details. Args: unittest.TestCase: TestCase class aids in the formation of test cases method to run before each test case. method that is run after each test case tests if the object is initialized in the right way tests that enables... | 4.111716 | 4 |
test/cluster_test/test.py | viyadb/viyadb | 109 | 6633271 | <gh_stars>100-1000
#!/usr/bin/env python3
import csv
import json
import kafka
import requests
import time
nodes = ['viyadb_1', 'viyadb_2']
columns = [
'app_id', 'user_id', 'event_time', 'country', 'city', 'device_type',
'device_vendor', 'ad_network', 'campaign', 'site_id', 'event_type',
'event_name', 'or... | #!/usr/bin/env python3
import csv
import json
import kafka
import requests
import time
nodes = ['viyadb_1', 'viyadb_2']
columns = [
'app_id', 'user_id', 'event_time', 'country', 'city', 'device_type',
'device_vendor', 'ad_network', 'campaign', 'site_id', 'event_type',
'event_name', 'organic', 'days_from_... | en | 0.81958 | #!/usr/bin/env python3 Return configuration written by ViyaDB node controller Check whether all the nodes are started by reading their controller config Send new micro-batches info to Kafka for triggering real-time ingestion | 2.511549 | 3 |
topictracking/RuleTopicTrackers.py | Dagu9/Reinforcement-learning-SGD | 0 | 6633272 | <reponame>Dagu9/Reinforcement-learning-SGD
###############################################################################
# PyDial: Multi-domain Statistical Spoken Dialogue System Software
###############################################################################
#
# Copyright 2015 - 2019
# Cambridge University E... | ###############################################################################
# PyDial: Multi-domain Statistical Spoken Dialogue System Software
###############################################################################
#
# Copyright 2015 - 2019
# Cambridge University Engineering Department Dialogue Systems Grou... | en | 0.717595 | ############################################################################### # PyDial: Multi-domain Statistical Spoken Dialogue System Software ############################################################################### # # Copyright 2015 - 2019 # Cambridge University Engineering Department Dialogue Systems Grou... | 1.496917 | 1 |
gram/migrations/0001_initial.py | nderituliz/Instagram-App | 0 | 6633273 | # Generated by Django 2.2.17 on 2021-01-26 19:49
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0011_update_proxy_permissions'),
migrations.swappable_... | # Generated by Django 2.2.17 on 2021-01-26 19:49
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0011_update_proxy_permissions'),
migrations.swappable_... | en | 0.823309 | # Generated by Django 2.2.17 on 2021-01-26 19:49 | 1.756914 | 2 |
NaturalLanguageProcessingWithPython/02/practice23_b.py | t2y/learnnlp | 4 | 6633274 | <filename>NaturalLanguageProcessingWithPython/02/practice23_b.py<gh_stars>1-10
# -*- coding: utf-8 -*-
import random
import pylab
from practice23_a import get_frequency_distribution
CHAR_NUM_LIMIT = 15
ORIGIN_WORDS = 'abcdefg'
def generate_words(num):
for _ in xrange(num):
yield ''.join(i for _ in xran... | <filename>NaturalLanguageProcessingWithPython/02/practice23_b.py<gh_stars>1-10
# -*- coding: utf-8 -*-
import random
import pylab
from practice23_a import get_frequency_distribution
CHAR_NUM_LIMIT = 15
ORIGIN_WORDS = 'abcdefg'
def generate_words(num):
for _ in xrange(num):
yield ''.join(i for _ in xran... | en | 0.769321 | # -*- coding: utf-8 -*- | 3.087717 | 3 |
2english-init.py | MalikKeio/valkyrie-anatomia-script | 0 | 6633275 | <filename>2english-init.py
#!/usr/bin/env python3
import os
from names import CHAPTERS, CHARACTERS
en_chapter = "en/"
if not os.path.exists(en_chapter):
os.makedirs(en_chapter)
for root, dirs, files in os.walk('jp/'):
for name in files:
path = os.path.join(root, name)
target_path = path.repla... | <filename>2english-init.py
#!/usr/bin/env python3
import os
from names import CHAPTERS, CHARACTERS
en_chapter = "en/"
if not os.path.exists(en_chapter):
os.makedirs(en_chapter)
for root, dirs, files in os.walk('jp/'):
for name in files:
path = os.path.join(root, name)
target_path = path.repla... | fr | 0.221828 | #!/usr/bin/env python3 | 3.024192 | 3 |
src/others/utils.py | wangdongmeizju/BertSum | 1,301 | 6633276 | <gh_stars>1000+
import os
import re
import shutil
import time
from others import pyrouge
REMAP = {"-lrb-": "(", "-rrb-": ")", "-lcb-": "{", "-rcb-": "}",
"-lsb-": "[", "-rsb-": "]", "``": '"', "''": '"'}
def clean(x):
return re.sub(
r"-lrb-|-rrb-|-lcb-|-rcb-|-lsb-|-rsb-|``|''",
lambda m... | import os
import re
import shutil
import time
from others import pyrouge
REMAP = {"-lrb-": "(", "-rrb-": ")", "-lcb-": "{", "-rcb-": "}",
"-lsb-": "[", "-rsb-": "]", "``": '"', "''": '"'}
def clean(x):
return re.sub(
r"-lrb-|-rrb-|-lcb-|-rcb-|-lsb-|-rsb-|``|''",
lambda m: REMAP.get(m.gr... | en | 0.518143 | #ID#.txt' #ID#.txt' | 2.120623 | 2 |
test-common/integrationtest/testcase/test_ns_client_ha.py | lotabout/OpenMLDB | 2,659 | 6633277 | <gh_stars>1000+
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2021 4Paradigm
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2021 4Paradigm
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | en | 0.479304 | #!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright 2021 4Paradigm # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required ... | 1.816585 | 2 |
async_service/trio.py | cburgdorf/async-service | 0 | 6633278 | <reponame>cburgdorf/async-service<gh_stars>0
import functools
import sys
from typing import Any, AsyncIterator, Awaitable, Callable, cast
from async_generator import asynccontextmanager
import trio
import trio_typing
from .abc import ManagerAPI, ServiceAPI
from .base import BaseManager
from .exceptions import DaemonT... | import functools
import sys
from typing import Any, AsyncIterator, Awaitable, Callable, cast
from async_generator import asynccontextmanager
import trio
import trio_typing
from .abc import ManagerAPI, ServiceAPI
from .base import BaseManager
from .exceptions import DaemonTaskExit, LifecycleError
from .typing import E... | en | 0.895642 | # A nursery for sub tasks and services. This nursery is cancelled if the # service is cancelled but allowed to exit normally if the service exits. # events # locks # # System Tasks # Handle cancellation of the task nursery. Handle cancellation of the system nursery. Run and monitor the actual :meth:`ServiceAPI.run` me... | 1.967356 | 2 |
browsepy/tests/test_main.py | galacticpolymath/browsepy | 164 | 6633279 | import unittest
import os
import os.path
import tempfile
import shutil
import browsepy.__main__
class TestMain(unittest.TestCase):
module = browsepy.__main__
def setUp(self):
self.app = browsepy.app
self.parser = self.module.ArgParse(sep=os.sep)
self.base = tempfile.mkdtemp()
... | import unittest
import os
import os.path
import tempfile
import shutil
import browsepy.__main__
class TestMain(unittest.TestCase):
module = browsepy.__main__
def setUp(self):
self.app = browsepy.app
self.parser = self.module.ArgParse(sep=os.sep)
self.base = tempfile.mkdtemp()
... | none | 1 | 2.46672 | 2 | |
Chapter 07/Implementing a simple majority vote classifier/program3.py | fagaiera/python-machine-learning-book-3rd-edition-examples | 0 | 6633280 | <gh_stars>0
from sklearn import datasets
from sklearn.model_selection import train_test_split
from sklearn.model_selection import cross_val_score
from sklearn.preprocessing import StandardScaler
from sklearn.preprocessing import LabelEncoder
from sklearn.linear_model import LogisticRegression
from sklearn.tree import D... | from sklearn import datasets
from sklearn.model_selection import train_test_split
from sklearn.model_selection import cross_val_score
from sklearn.preprocessing import StandardScaler
from sklearn.preprocessing import LabelEncoder
from sklearn.linear_model import LogisticRegression
from sklearn.tree import DecisionTreeC... | none | 1 | 2.592232 | 3 | |
scraper/dzoneScraper.py | AnshG714/sweeger | 0 | 6633281 | <gh_stars>0
from common import Article
import requests
from bs4 import BeautifulSoup
from selenium import webdriver
import time
import os
def getDzoneURL(topic, pageNumber):
assert type(pageNumber) == int and pageNumber >= 1
# f-string formatting will only work on Python 3.6+
return f'https://dzone.com/{... | from common import Article
import requests
from bs4 import BeautifulSoup
from selenium import webdriver
import time
import os
def getDzoneURL(topic, pageNumber):
assert type(pageNumber) == int and pageNumber >= 1
# f-string formatting will only work on Python 3.6+
return f'https://dzone.com/{topic}/list?... | en | 0.851277 | # f-string formatting will only work on Python 3.6+ # This function is needed because DZone is written in Angular all components # are dynamically JS-rendered. # Configure Chrome options # So we don't need to actually open a new Window # Instantiate Chromium driver # Instantiate BS object # flatten list | 3.108028 | 3 |
mapentity/serializers/helpers.py | GeotrekCE/Geotrek-admin | 50 | 6633282 | from decimal import Decimal
from functools import partial
import html
import json
from django.core.serializers import serialize
from django.core.serializers.json import DjangoJSONEncoder
from django.db.models.query import QuerySet
from django.utils.encoding import force_str
from django.utils.encoding import smart_str
... | from decimal import Decimal
from functools import partial
import html
import json
from django.core.serializers import serialize
from django.core.serializers.json import DjangoJSONEncoder
from django.db.models.query import QuerySet
from django.utils.encoding import force_str
from django.utils.encoding import smart_str
... | en | 0.547052 | # Converts to unicode, remove HTML tags, convert HTML entities Taken (slightly modified) from: http://stackoverflow.com/questions/2249792/json-serializing-django-models-with-simplejson # https://docs.djangoproject.com/en/dev/topics/serialization/#id2 # `default` must return a python serializable # structure, the ea... | 2.194548 | 2 |
quantecon/ecdf.py | gosccm/Learning | 1 | 6633283 | """
Filename: ecdf.py
Authors: <NAME>, <NAME>
Implements the empirical cumulative distribution function given an array
of observations.
"""
import numpy as np
class ECDF:
"""
One-dimensional empirical distribution function given a vector of
observations.
Parameters
----------
observations... | """
Filename: ecdf.py
Authors: <NAME>, <NAME>
Implements the empirical cumulative distribution function given an array
of observations.
"""
import numpy as np
class ECDF:
"""
One-dimensional empirical distribution function given a vector of
observations.
Parameters
----------
observations... | en | 0.592185 | Filename: ecdf.py Authors: <NAME>, <NAME> Implements the empirical cumulative distribution function given an array of observations. One-dimensional empirical distribution function given a vector of observations. Parameters ---------- observations : array_like An array of observations Att... | 3.082415 | 3 |
utils/custom_methods.py | alexanderwendt/sklearn_ml_toolbox | 1 | 6633284 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import datetime
#import data_visualization_functions as vis
def load_source(source_path):
'''
Load stock charts as source
'''
source = pd.read_csv(source_path, sep=';')
source.index.name = "... | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import datetime
#import data_visualization_functions as vis
def load_source(source_path):
'''
Load stock charts as source
'''
source = pd.read_csv(source_path, sep=';')
source.index.name = "... | en | 0.81788 | #import data_visualization_functions as vis Load stock charts as source | 2.869581 | 3 |
lib/pyramid.py | rpautrat/d2_net | 0 | 6633285 | import torch
import torch.nn as nn
import torch.nn.functional as F
from .exceptions import EmptyTensorError
from .utils import interpolate_dense_features, upscale_positions
def process_multiscale(image, model, scales=[.5, 1, 2]):
b, _, h_init, w_init = image.size()
device = image.device
assert(b == 1)
... | import torch
import torch.nn as nn
import torch.nn.functional as F
from .exceptions import EmptyTensorError
from .utils import interpolate_dense_features, upscale_positions
def process_multiscale(image, model, scales=[.5, 1, 2]):
b, _, h_init, w_init = image.size()
device = image.device
assert(b == 1)
... | en | 0.651714 | # Sum the feature maps. # Recover detections. # Recover displacements. | 1.883443 | 2 |
analysis/permeability_profiles/abf_pmf_processor.py | vtlim/permeability | 1 | 6633286 | <filename>analysis/permeability_profiles/abf_pmf_processor.py
import numpy as np
import numpy_indexed as npi
from scipy import integrate
# TODO: consider making the plotting lines in the main function more modular
# TODO: check that file exists in __init__
# TODO: add diagram from group meeting to Github
class Profi... | <filename>analysis/permeability_profiles/abf_pmf_processor.py
import numpy as np
import numpy_indexed as npi
from scipy import integrate
# TODO: consider making the plotting lines in the main function more modular
# TODO: check that file exists in __init__
# TODO: add diagram from group meeting to Github
class Profi... | en | 0.643892 | # TODO: consider making the plotting lines in the main function more modular # TODO: check that file exists in __init__ # TODO: add diagram from group meeting to Github # if xdata and ydata are NOT passed, initiate object from file # only unpack x and y data (ignoring error column if present) Getter for infile. Getter ... | 2.470529 | 2 |
edge/python/modify-host-origin-request-header/.aws-sam/build/ModifyRequestHeaderFunction/app.py | Joe-Wu-88/my-test-repository | 0 | 6633287 | import os
def lambda_handler(event, context):
request = event['Records'][0]['cf']['request']
originDomain = os.environ['originDomain']
request['headers']['host'][0]['value'] = originDomain;
return request
| import os
def lambda_handler(event, context):
request = event['Records'][0]['cf']['request']
originDomain = os.environ['originDomain']
request['headers']['host'][0]['value'] = originDomain;
return request
| none | 1 | 2.104616 | 2 | |
exams/Messages Manager.py | nrgxtra/fundamentals | 0 | 6633288 | users_base = dict()
capacity = int(input())
while True:
command = input()
if command == 'Statistics':
break
tokens = command.split('=')
com = tokens[0]
if com == 'Add':
username = tokens[1]
sent = int(tokens[2])
received = int(tokens[3])
if usernam... | users_base = dict()
capacity = int(input())
while True:
command = input()
if command == 'Statistics':
break
tokens = command.split('=')
com = tokens[0]
if com == 'Add':
username = tokens[1]
sent = int(tokens[2])
received = int(tokens[3])
if usernam... | none | 1 | 3.363749 | 3 | |
vectorhub/encoders/image/tfhub/inception_resnet.py | NanaAkwasiAbayieBoateng/vectorhub | 1 | 6633289 | from ..base import BaseImage2Vec
from ....base import catch_vector_errors
from ....doc_utils import ModelDefinition
from ....import_utils import *
if is_all_dependency_installed('encoders-image-tfhub'):
import tensorflow as tf
import tensorflow_hub as hub
import traceback
from datetime import date
Incepti... | from ..base import BaseImage2Vec
from ....base import catch_vector_errors
from ....doc_utils import ModelDefinition
from ....import_utils import *
if is_all_dependency_installed('encoders-image-tfhub'):
import tensorflow as tf
import tensorflow_hub as hub
import traceback
from datetime import date
Incepti... | en | 0.875281 | Very deep convolutional networks have been central to the largest advances in image recognition performance in recent years. One example is the Inception architecture that has been shown to achieve very good performance at relatively low computational cost. Recently, the introduction of residual connections in conjun... | 2.148487 | 2 |
fuji/settingsclass.py | startechsheffield/startech | 0 | 6633290 | from os.path import exists
from fuji.generalclass import checkToken
from fuji.listclass import align
def __checkstr__(val):
if not val.find("\n") < 0:
return(False)
badChars = "{|}"
for c in range(len(val)):
if not badChars.find(val[c]) < 0:
return(False)
return(True)
def __convert__(val):
val = val.replace... | from os.path import exists
from fuji.generalclass import checkToken
from fuji.listclass import align
def __checkstr__(val):
if not val.find("\n") < 0:
return(False)
badChars = "{|}"
for c in range(len(val)):
if not badChars.find(val[c]) < 0:
return(False)
return(True)
def __convert__(val):
val = val.replace... | none | 1 | 2.547824 | 3 | |
toSort/inMoovHandRobot.py | sola1993/inmoov | 1 | 6633291 | <filename>toSort/inMoovHandRobot.py
from java.lang import String
from org.myrobotlab.service import Speech
from org.myrobotlab.service import Sphinx
from org.myrobotlab.service import Runtime
# This demo is a basic speech recognition script.
#
# A set of commands needs to be defined before the recognizer starts
# Inte... | <filename>toSort/inMoovHandRobot.py
from java.lang import String
from org.myrobotlab.service import Speech
from org.myrobotlab.service import Sphinx
from org.myrobotlab.service import Runtime
# This demo is a basic speech recognition script.
#
# A set of commands needs to be defined before the recognizer starts
# Inte... | en | 0.776147 | # This demo is a basic speech recognition script. # # A set of commands needs to be defined before the recognizer starts # Internet connectivity is needed initially to download the audio files # of the Speech service (its default behavior interfaces with Google) # once the phrases are spoken once, the files are used fr... | 3.276354 | 3 |
runner/deps/pg8000/dbapi.py | Tanzu-Solutions-Engineering/benchmark | 0 | 6633292 | <reponame>Tanzu-Solutions-Engineering/benchmark
# vim: sw=4:expandtab:foldmethod=marker
#
# Copyright (c) 2007-2009, <NAME>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions ... | # vim: sw=4:expandtab:foldmethod=marker
#
# Copyright (c) 2007-2009, <NAME>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright n... | en | 0.77719 | # vim: sw=4:expandtab:foldmethod=marker # # Copyright (c) 2007-2009, <NAME> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright n... | 1.371917 | 1 |
docs/loadcensus/configureCensus.py | azavea/district-builder-dtl-pa | 5 | 6633293 | <reponame>azavea/district-builder-dtl-pa
#!/usr/bin/env python
# Framework for loading census data
# Inputs: FIPS state code, list of variables to include as additional subjects
# Requirements:
# - external software: DistrictBuilder, R, gdal, wget, unzip
# TODO -- check for VTD's
import re # regular expre... | #!/usr/bin/env python
# Framework for loading census data
# Inputs: FIPS state code, list of variables to include as additional subjects
# Requirements:
# - external software: DistrictBuilder, R, gdal, wget, unzip
# TODO -- check for VTD's
import re # regular expressions
import sys # arg lists etc
im... | en | 0.453241 | #!/usr/bin/env python # Framework for loading census data # Inputs: FIPS state code, list of variables to include as additional subjects # Requirements: # - external software: DistrictBuilder, R, gdal, wget, unzip # TODO -- check for VTD's # regular expressions # arg lists etc # globbing # system commands # os co... | 2.31706 | 2 |
georinex/nav2.py | mrsnhl/georinex | 1 | 6633294 | <filename>georinex/nav2.py
#!/usr/bin/env python
from pathlib import Path
from datetime import datetime
from typing import Dict, Union, Any, Sequence
from typing.io import TextIO
import xarray
import numpy as np
import logging
from .rio import opener, rinexinfo
from .common import rinex_string_to_float
#
STARTCOL2 = 3... | <filename>georinex/nav2.py
#!/usr/bin/env python
from pathlib import Path
from datetime import datetime
from typing import Dict, Union, Any, Sequence
from typing.io import TextIO
import xarray
import numpy as np
import logging
from .rio import opener, rinexinfo
from .common import rinex_string_to_float
#
STARTCOL2 = 3... | en | 0.793765 | #!/usr/bin/env python # # column where numerical data starts for RINEX 2 # number of additional SV lines Reads RINEX 2.x NAV files <NAME>, Ph.D. SciVision, Inc. http://gage14.upc.es/gLAB/HTML/GPS_Navigation_Rinex_v2.11.html ftp://igs.org/pub/data/format/rinex211.txt # string length per field # GLONASS ... | 2.584472 | 3 |
Cogs/settings.py | bobo3769/VirusTotalDiscordBot | 5 | 6633295 | <reponame>bobo3769/VirusTotalDiscordBot
import random
from discord import Colour
"""
These are some presets configs, that are predefined
and normally dont need any changes (Thats why they are not in the config file
"""
bottest = True # decides if the bot checks other bots messages
ignorfiles = ['image/gif', 'image... | import random
from discord import Colour
"""
These are some presets configs, that are predefined
and normally dont need any changes (Thats why they are not in the config file
"""
bottest = True # decides if the bot checks other bots messages
ignorfiles = ['image/gif', 'image/jpeg'] # Content types to ignor. Check... | en | 0.841309 | These are some presets configs, that are predefined and normally dont need any changes (Thats why they are not in the config file # decides if the bot checks other bots messages # Content types to ignor. Check out https://en.wikipedia.org/wiki/Media_type # if more or equal than that checks are positive the embed will b... | 2.507378 | 3 |
tests/test_games/test_core/test_deck.py | joedaws/card-player | 0 | 6633296 | import pytest
from cartomancy.games.core.deck import Deck
@pytest.fixture
def deck():
return Deck()
def test_deck(deck):
assert hasattr(deck, 'draw')
assert hasattr(deck, 'shuffle')
assert hasattr(deck, '__len__')
assert hasattr(deck, '__str__')
| import pytest
from cartomancy.games.core.deck import Deck
@pytest.fixture
def deck():
return Deck()
def test_deck(deck):
assert hasattr(deck, 'draw')
assert hasattr(deck, 'shuffle')
assert hasattr(deck, '__len__')
assert hasattr(deck, '__str__')
| none | 1 | 2.655797 | 3 | |
cv/apps.py | mikebader/django-cv | 3 | 6633297 | <reponame>mikebader/django-cv<gh_stars>1-10
from django.apps import AppConfig
import cv
class CvConfig(AppConfig):
name = 'cv'
verbose_name = 'CV'
def ready(self):
import cv.signals
| from django.apps import AppConfig
import cv
class CvConfig(AppConfig):
name = 'cv'
verbose_name = 'CV'
def ready(self):
import cv.signals | none | 1 | 1.472975 | 1 | |
BNB/tests/test_BNB0.py | celioggr/erc20-pbt | 5 | 6633298 | import pytest
from erc20_pbt import StateMachine
@pytest.fixture()
def contract2test(BNB):
yield BNB
class BNB(StateMachine):
def __init__(self, accounts, contract2test):
contract = contract2test.deploy(
1000, "BNB", 18, "BNB", {"from": accounts[0]}
)
StateMachine.__init_... | import pytest
from erc20_pbt import StateMachine
@pytest.fixture()
def contract2test(BNB):
yield BNB
class BNB(StateMachine):
def __init__(self, accounts, contract2test):
contract = contract2test.deploy(
1000, "BNB", 18, "BNB", {"from": accounts[0]}
)
StateMachine.__init_... | en | 0.385355 | Overwrite state machine brownie.reverts() to search for a revert comment string Overwrite state machine brownie.reverts() to search for a revert comment string | 2.238061 | 2 |
apex/transformer/utils.py | neon-wild/apex | 0 | 6633299 | """Utility functions used by both `pipeline_parallel` and `tensor_parallel`"""
import torch
from apex.transformer import parallel_state
def ensure_divisibility(numerator, denominator):
"""Ensure that numerator is divisible by the denominator."""
assert numerator % denominator == 0, "{} is not divisible by {}... | """Utility functions used by both `pipeline_parallel` and `tensor_parallel`"""
import torch
from apex.transformer import parallel_state
def ensure_divisibility(numerator, denominator):
"""Ensure that numerator is divisible by the denominator."""
assert numerator % denominator == 0, "{} is not divisible by {}... | en | 0.759719 | Utility functions used by both `pipeline_parallel` and `tensor_parallel` Ensure that numerator is divisible by the denominator. Ensure that numerator is divisible by the denominator and return the division value. Break a tensor into equal 1D chunks. Opposite of above function, gather values from model parallel rank... | 2.685267 | 3 |
Test Code/speak_reg/one_user_rec.py | joexu01/speak_auth | 0 | 6633300 | <gh_stars>0
from pyAudioAnalysis import audioBasicIO
from pyAudioAnalysis import audioFeatureExtraction
import matplotlib.pyplot as plt
import numpy as np
from sklearn import mixture
from sklearn import svm
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import cross_val_score
from skle... | from pyAudioAnalysis import audioBasicIO
from pyAudioAnalysis import audioFeatureExtraction
import matplotlib.pyplot as plt
import numpy as np
from sklearn import mixture
from sklearn import svm
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import cross_val_score
from sklearn.mixture ... | en | 0.124609 | # 提取特征 # clf_svm = svm.SVC(gamma='scale', decision_function_shape='ovo') # clf_svm.fit(data_matrix, label_matrix) # lt->list, lb->label # 预测 # result_str = '' # if calculate_rate(result.tolist(), float(result.shape[0]), p_dir) >= RATE: # print('Yes '), # else: # print('No'), | 2.711553 | 3 |
simfempy/meshes/__init__.py | anairabeze/simfempy | 0 | 6633301 |
from . import simplexmesh, plotmesh, testmeshes
|
from . import simplexmesh, plotmesh, testmeshes
| none | 1 | 0.936074 | 1 | |
source/texture.py | matheusmmoliveira/BrickBreaker | 0 | 6633302 | <gh_stars>0
import pygame
from settings import *
import os
class BlockTextureMapper:
def __init__(self):
blk_dir = os.path.join(BASE_DIR, 'assets', 'imgs', 'blocks')
self.block_textures = {file.replace('.png', ''): pygame.image.load(os.path.join(blk_dir, file)).convert_alpha()
... | import pygame
from settings import *
import os
class BlockTextureMapper:
def __init__(self):
blk_dir = os.path.join(BASE_DIR, 'assets', 'imgs', 'blocks')
self.block_textures = {file.replace('.png', ''): pygame.image.load(os.path.join(blk_dir, file)).convert_alpha()
f... | none | 1 | 2.79528 | 3 | |
brood_backend/__main__.py | jonadaly/brood-backend | 0 | 6633303 | import os
import waitress
from brood_backend.app import create_app
PORT = os.getenv("PORT", 8080)
if __name__ == "__main__":
app = create_app()
waitress.serve(app, host="0.0.0.0", port=PORT)
| import os
import waitress
from brood_backend.app import create_app
PORT = os.getenv("PORT", 8080)
if __name__ == "__main__":
app = create_app()
waitress.serve(app, host="0.0.0.0", port=PORT)
| none | 1 | 1.639164 | 2 | |
aiida_quantumespresso/calculations/pw2wannier90.py | ltalirz/aiida-quantumespresso | 0 | 6633304 | <filename>aiida_quantumespresso/calculations/pw2wannier90.py
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from aiida.orm import RemoteData, FolderData, SinglefileData, Dict
from aiida_quantumespresso.calculations.namelists import NamelistsCalculation
class Pw2wannier90Calculation(NamelistsCalculatio... | <filename>aiida_quantumespresso/calculations/pw2wannier90.py
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from aiida.orm import RemoteData, FolderData, SinglefileData, Dict
from aiida_quantumespresso.calculations.namelists import NamelistsCalculation
class Pw2wannier90Calculation(NamelistsCalculatio... | en | 0.666956 | # -*- coding: utf-8 -*- pw2wannier90.x code of the Quantum ESPRESSO distribution, handles the calculation of the Amn, Mmn, ... files to be used to compute Wannier functions with the Wannier90 code. For more information, refer to http://www.quantum-espresso.org/ and http://www.wannier.org/ # By default ... | 2.210279 | 2 |
43. Multiply Strings.py | fossabot/leetcode-2 | 2 | 6633305 | <reponame>fossabot/leetcode-2
class Solution:
def multiply(self, num1, num2):
a=int(num1)
b=int(num2)
return str(a*b) | class Solution:
def multiply(self, num1, num2):
a=int(num1)
b=int(num2)
return str(a*b) | none | 1 | 3.344738 | 3 | |
spiceup_labels/patch_calendar_tasks.py | nens/spiceup-labels | 0 | 6633306 | # -*- coding: utf-8 -*-
"""Configure labeltype model for the crop calendar tasks of the SpiceUp mobile app.
Used to calculate farm specific tasks from parcel location, plant age, local measurements and raster data.
Calendar tasks are generated with a Lizard labeltype. This labeltype generates crop calendar tasks per pl... | # -*- coding: utf-8 -*-
"""Configure labeltype model for the crop calendar tasks of the SpiceUp mobile app.
Used to calculate farm specific tasks from parcel location, plant age, local measurements and raster data.
Calendar tasks are generated with a Lizard labeltype. This labeltype generates crop calendar tasks per pl... | en | 0.77254 | # -*- coding: utf-8 -*- Configure labeltype model for the crop calendar tasks of the SpiceUp mobile app. Used to calculate farm specific tasks from parcel location, plant age, local measurements and raster data. Calendar tasks are generated with a Lizard labeltype. This labeltype generates crop calendar tasks per plot.... | 2.350521 | 2 |
tests/other/test_aiohttp.py | true2blue/firestone-engine | 0 | 6633307 | import tushare as ts
import asyncio
from apscheduler.schedulers.background import BackgroundScheduler
from apscheduler.triggers.cron import CronTrigger
import time
from datetime import datetime
async def get_data(l):
df = await ts.get_realtime_quotes(l)
print(df)
def run():
print(f'start =... | import tushare as ts
import asyncio
from apscheduler.schedulers.background import BackgroundScheduler
from apscheduler.triggers.cron import CronTrigger
import time
from datetime import datetime
async def get_data(l):
df = await ts.get_realtime_quotes(l)
print(df)
def run():
print(f'start =... | none | 1 | 2.620311 | 3 | |
calamari_ocr/ocr/dataset/params.py | jacektl/calamari | 922 | 6633308 | from dataclasses import dataclass, field
from typing import Optional
from paiargparse import pai_dataclass, pai_meta
from tfaip import DataBaseParams
from calamari_ocr.ocr.dataset.codec import Codec
from calamari_ocr.ocr.dataset.datareader.abbyy.reader import Abbyy
from calamari_ocr.ocr.dataset.datareader.file import... | from dataclasses import dataclass, field
from typing import Optional
from paiargparse import pai_dataclass, pai_meta
from tfaip import DataBaseParams
from calamari_ocr.ocr.dataset.codec import Codec
from calamari_ocr.ocr.dataset.datareader.abbyy.reader import Abbyy
from calamari_ocr.ocr.dataset.datareader.file import... | en | 0.9934 | # Set based on model # Set based on model | 1.972796 | 2 |
facedetection.py | MachineLearning-Nerd/FaceDetection | 0 | 6633309 | <gh_stars>0
import dlib
import cv2
from drawmarks import renderFace
if __name__ == "__main__":
# Convert the rectangle in to the tuple of the dlib.rectangle output
def point_to_rectangle(rectangle):
# Take the input from the frontal face detector
# e.g facedetector = dlib.get_frontal_face_det... | import dlib
import cv2
from drawmarks import renderFace
if __name__ == "__main__":
# Convert the rectangle in to the tuple of the dlib.rectangle output
def point_to_rectangle(rectangle):
# Take the input from the frontal face detector
# e.g facedetector = dlib.get_frontal_face_detector()
... | en | 0.80764 | # Convert the rectangle in to the tuple of the dlib.rectangle output # Take the input from the frontal face detector # e.g facedetector = dlib.get_frontal_face_detector() # This is the function for the writing the data into the files # Put the predictor path here which is the pretrained path # Call the face detector # ... | 3.069812 | 3 |
sample/how_ocr_works.py | uzstudio/findit | 91 | 6633310 | """
OCR engine binding to tesseract engine.
tesseract engine: https://github.com/tesseract-ocr/tesseract
tesseract language data: https://github.com/tesseract-ocr/tesseract/wiki/Data-Files#data-files-for-version-400-november-29-2016
tesserocr (python wrapper of tesseract): https://github.com/sirfz/tesserocr
"""
impo... | """
OCR engine binding to tesseract engine.
tesseract engine: https://github.com/tesseract-ocr/tesseract
tesseract language data: https://github.com/tesseract-ocr/tesseract/wiki/Data-Files#data-files-for-version-400-november-29-2016
tesserocr (python wrapper of tesseract): https://github.com/sirfz/tesserocr
"""
impo... | en | 0.571591 | OCR engine binding to tesseract engine. tesseract engine: https://github.com/tesseract-ocr/tesseract tesseract language data: https://github.com/tesseract-ocr/tesseract/wiki/Data-Files#data-files-for-version-400-november-29-2016 tesserocr (python wrapper of tesseract): https://github.com/sirfz/tesserocr # or ... # you... | 2.666722 | 3 |
tests/test_gfapy_line_containment.py | ujjwalsh/gfapy | 44 | 6633311 | import unittest
import gfapy
class TestLineContainment(unittest.TestCase):
def test_from_string(self):
fields = ["C","1","+","2","-","12","12M","MQ:i:1232","NM:i:3","ab:Z:abcd"]
string="\t".join(fields)
gfapy.Line(string)
self.assertIsInstance(gfapy.Line(string), gfapy.line.edge.Containment)
sel... | import unittest
import gfapy
class TestLineContainment(unittest.TestCase):
def test_from_string(self):
fields = ["C","1","+","2","-","12","12M","MQ:i:1232","NM:i:3","ab:Z:abcd"]
string="\t".join(fields)
gfapy.Line(string)
self.assertIsInstance(gfapy.Line(string), gfapy.line.edge.Containment)
sel... | none | 1 | 3.023729 | 3 | |
pysongman/views/library/audio.py | devdave/pysongman | 1 | 6633312 | from pysongman.lib.qtd import QtWidgets, Qt
from pysongman.lib.qtd import QHBoxLayout
from pysongman.lib.qtd import QVBoxLayout
from pysongman.lib.qtd import QLabel
from pysongman.lib.qtd import QLineEdit
from pysongman.lib.qtd import QPushButton
from pysongman.lib.qtd import QFrame
class AudioWindow(QtWidgets.QWidge... | from pysongman.lib.qtd import QtWidgets, Qt
from pysongman.lib.qtd import QHBoxLayout
from pysongman.lib.qtd import QVBoxLayout
from pysongman.lib.qtd import QLabel
from pysongman.lib.qtd import QLineEdit
from pysongman.lib.qtd import QPushButton
from pysongman.lib.qtd import QFrame
class AudioWindow(QtWidgets.QWidge... | en | 0.25047 | frame VBOX HBOX # Search label # Line edit # clear button ############################################## HBOX # Artist Table | SPLITTER | Album Table |SPLITTER | # Song table # # get rid of the vertical headers | 2.600228 | 3 |
src/NumberEngine.py | VaclavSevcik/MathKing | 0 | 6633313 | <filename>src/NumberEngine.py
from src.exceptions import ParseConfigException
import random
# TODO constrain number of example
# TODO - constrain - more then EXAMPLE_TO_PAGE example overflow one page - need count page and write to previous page in method __writeExamplesToPDF
EXAMPLE_TO_PAGE = 132
class NumberEngine:
... | <filename>src/NumberEngine.py
from src.exceptions import ParseConfigException
import random
# TODO constrain number of example
# TODO - constrain - more then EXAMPLE_TO_PAGE example overflow one page - need count page and write to previous page in method __writeExamplesToPDF
EXAMPLE_TO_PAGE = 132
class NumberEngine:
... | en | 0.737899 | # TODO constrain number of example # TODO - constrain - more then EXAMPLE_TO_PAGE example overflow one page - need count page and write to previous page in method __writeExamplesToPDF The class NumberEngine provides generate examples according to configuration from application window. The method sets all inner data fro... | 3.308687 | 3 |
alteia/core/resources/sharetokens.py | alteia-ai/alteia-python-sdk | 11 | 6633314 | <gh_stars>10-100
from typing import List, NamedTuple
from alteia.core.utils.typing import ShareToken
ShareTokensWithTotal = NamedTuple(
'ShareTokensWithTotal',
[('total', int), ('results', List[ShareToken])]
)
| from typing import List, NamedTuple
from alteia.core.utils.typing import ShareToken
ShareTokensWithTotal = NamedTuple(
'ShareTokensWithTotal',
[('total', int), ('results', List[ShareToken])]
) | none | 1 | 2.298903 | 2 | |
setup.py | mao2009/Python_Counter | 0 | 6633315 | from setuptools import setup
from os import path
with open('README.md') as f:
long_description = f.read()
setup(
name='itrcnt',
module='itrcnt.py',
version='0.1.2',
license='BSD',
author='mao2009',
url='https://github.com/mao2009/Python_Counter',
description='Alternative for Range ... | from setuptools import setup
from os import path
with open('README.md') as f:
long_description = f.read()
setup(
name='itrcnt',
module='itrcnt.py',
version='0.1.2',
license='BSD',
author='mao2009',
url='https://github.com/mao2009/Python_Counter',
description='Alternative for Range ... | none | 1 | 1.509625 | 2 | |
scripts/remote_cam_view.py | KingTaTo/CS321-Racer-1 | 0 | 6633316 | """
Scripts to drive a donkey car remotely
Usage:
remote_cam_view.py --name=<robot_name> --broker="localhost" [--record=<path>]
Options:
-h --help Show this screen.
"""
import os
import time
import math
from docopt import docopt
import donkeycar as dk
import cv2
from donkeycar.parts.cv ... | """
Scripts to drive a donkey car remotely
Usage:
remote_cam_view.py --name=<robot_name> --broker="localhost" [--record=<path>]
Options:
-h --help Show this screen.
"""
import os
import time
import math
from docopt import docopt
import donkeycar as dk
import cv2
from donkeycar.parts.cv ... | en | 0.472584 | Scripts to drive a donkey car remotely
Usage:
remote_cam_view.py --name=<robot_name> --broker="localhost" [--record=<path>]
Options:
-h --help Show this screen. | 2.651703 | 3 |
tests/test_logzioSender.py | hilsenrat/logzio-python-handler | 31 | 6633317 | <gh_stars>10-100
import fnmatch
import logging.config
import os
import time
from unittest import TestCase
from .mockLogzioListener import listener
def _find(pattern, path):
result = []
for root, dirs, files in os.walk(path):
for name in files:
if fnmatch.fnmatch(name, pattern):
... | import fnmatch
import logging.config
import os
import time
from unittest import TestCase
from .mockLogzioListener import listener
def _find(pattern, path):
result = []
for root, dirs, files in os.walk(path):
for name in files:
if fnmatch.fnmatch(name, pattern):
result.appe... | en | 0.947567 | # Not descending recursively # Longer, because of the retry # Make sure no file is present # All of the retries # Make sure no file is present # All of the retries # Make sure no file was created # Log from the child process # Wait for the child process to finish # log from the parent process # Ensure listener receive ... | 2.468078 | 2 |
middleSchool.py | BrianCarela/google-python-exercises | 0 | 6633318 | <filename>middleSchool.py
import sys
def main():
u_gay = raw_input("Are you gay? (yes/no)")
if(u_gay == "no"):
trick = raw_input("Does your mom know you're gay? (yes/no)")
if(trick == "no"):
print("LOL ur gay bro")
else:
print("... Bet")
elif(u_gay == "yes"):... | <filename>middleSchool.py
import sys
def main():
u_gay = raw_input("Are you gay? (yes/no)")
if(u_gay == "no"):
trick = raw_input("Does your mom know you're gay? (yes/no)")
if(trick == "no"):
print("LOL ur gay bro")
else:
print("... Bet")
elif(u_gay == "yes"):... | none | 1 | 3.646694 | 4 | |
engine/objects/primitives/icollider.py | vityaman/Pygame2DGameEngine | 0 | 6633319 | <reponame>vityaman/Pygame2DGameEngine<filename>engine/objects/primitives/icollider.py
from abc import ABC, abstractmethod
from engine.objects.primitives.vector2d import Vector2D
class ICollider(ABC):
@abstractmethod
def collides_with(self, other: 'ICollider') -> bool:
raise NotImplementedError()
... | from abc import ABC, abstractmethod
from engine.objects.primitives.vector2d import Vector2D
class ICollider(ABC):
@abstractmethod
def collides_with(self, other: 'ICollider') -> bool:
raise NotImplementedError()
@property
@abstractmethod
def position(self) -> Vector2D:
raise NotIm... | none | 1 | 3.397919 | 3 | |
demo.py | B-C-WANG/MachineLearningTools | 3 | 6633320 | from soapml.Dataset import Dataset
from MLT.VAE.VAE1D import VAE1D
import numpy as np
from MLT.Regression.LinearNNFeatureExtraction import LinearNN
from MLT.Regression.GBR_FeatureImportanceEstimater import GBRFIE
def gbr_feature():
model = GBRFIE(X, y, test_split_ratio=0.3)
model.fit(n_estimators=40)
erro... | from soapml.Dataset import Dataset
from MLT.VAE.VAE1D import VAE1D
import numpy as np
from MLT.Regression.LinearNNFeatureExtraction import LinearNN
from MLT.Regression.GBR_FeatureImportanceEstimater import GBRFIE
def gbr_feature():
model = GBRFIE(X, y, test_split_ratio=0.3)
model.fit(n_estimators=40)
erro... | en | 0.699271 | # make it can be // by batch size # normalize data | 2.673519 | 3 |
challenges/2022-03-08-hidden-digits/solutions/python/xanderyzwich/xanderyzwich.py | aureliefomum/CodingDojo-1 | 0 | 6633321 | <filename>challenges/2022-03-08-hidden-digits/solutions/python/xanderyzwich/xanderyzwich.py
from unittest import TestCase
def hidden_digits(time_str):
result = ''
# Hours
first_hidden = '?' == time_str[0]
second_hidden = '?' == time_str[1]
if first_hidden and second_hidden:
result += '23'... | <filename>challenges/2022-03-08-hidden-digits/solutions/python/xanderyzwich/xanderyzwich.py
from unittest import TestCase
def hidden_digits(time_str):
result = ''
# Hours
first_hidden = '?' == time_str[0]
second_hidden = '?' == time_str[1]
if first_hidden and second_hidden:
result += '23'... | en | 0.3368 | # Hours # Separator # Minutes | 3.634702 | 4 |
tests/functional/test_model_completeness.py | doc-E-brown/botocore | 2 | 6633322 | # Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | # Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | en | 0.872452 | # Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). You # may not use this file except in compliance with the License. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file accompa... | 2.060454 | 2 |
libtf/logparsers/tf_http_log.py | ThreshingFloor/libtf | 0 | 6633323 | from .tf_generic_log import TFGenericLog
class TFHttpLog(TFGenericLog):
def __init__(self, line_iterator, api_key, ports=None, base_uri=None):
# Default to commonly used HTTP ports if not specified
if not ports:
ports = ["80:tcp", "8080:tcp", "443:tcp"]
super(TFHttpLog, self)... | from .tf_generic_log import TFGenericLog
class TFHttpLog(TFGenericLog):
def __init__(self, line_iterator, api_key, ports=None, base_uri=None):
# Default to commonly used HTTP ports if not specified
if not ports:
ports = ["80:tcp", "8080:tcp", "443:tcp"]
super(TFHttpLog, self)... | en | 0.400536 | # Default to commonly used HTTP ports if not specified | 2.094649 | 2 |
benchmarks/producer.py | alauda/aster | 1 | 6633324 | <filename>benchmarks/producer.py
# -*- coding: utf-8 -*-
from kafka import KafkaProducer
producer = KafkaProducer(bootstrap_servers='localhost:9092')
if __name__ == '__main__':
s='0123456789abcdef'
i=0
while i<13:
i+=1
s = s +s
message_count = 30000
for _ in range(message_count)... | <filename>benchmarks/producer.py
# -*- coding: utf-8 -*-
from kafka import KafkaProducer
producer = KafkaProducer(bootstrap_servers='localhost:9092')
if __name__ == '__main__':
s='0123456789abcdef'
i=0
while i<13:
i+=1
s = s +s
message_count = 30000
for _ in range(message_count)... | en | 0.769321 | # -*- coding: utf-8 -*- | 2.091256 | 2 |
src/wheezy/captcha/comp.py | akornatskyy/wheezy.captcha | 4 | 6633325 | <gh_stars>1-10
""" ``comp`` module.
"""
try: # pragma: nocover
from PIL import Image, ImageFilter
from PIL.ImageColor import getrgb
from PIL.ImageDraw import Draw
from PIL.ImageFont import truetype
except ImportError: # pragma: nocover
import Image # noqa
import ImageFilter # noqa
from ... | """ ``comp`` module.
"""
try: # pragma: nocover
from PIL import Image, ImageFilter
from PIL.ImageColor import getrgb
from PIL.ImageDraw import Draw
from PIL.ImageFont import truetype
except ImportError: # pragma: nocover
import Image # noqa
import ImageFilter # noqa
from ImageColor impo... | uz | 0.261562 | ``comp`` module. # pragma: nocover # pragma: nocover # noqa # noqa # noqa # noqa # noqa | 1.127334 | 1 |
tools/demo.py | yellowstarhx/person_search | 768 | 6633326 | <filename>tools/demo.py<gh_stars>100-1000
import _init_paths
import argparse
import time
import os
import sys
import os.path as osp
from glob import glob
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import caffe
from mpi4py import MPI
from fast_rcnn.test_probe import demo_exfeat
from f... | <filename>tools/demo.py<gh_stars>100-1000
import _init_paths
import argparse
import time
import os
import sys
import os.path as osp
from glob import glob
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import caffe
from mpi4py import MPI
from fast_rcnn.test_probe import demo_exfeat
from f... | en | 0.882159 | # Setup caffe # Get query image and roi # [x1, y1, x2, y2] # Extract feature of the query person # Necessary to release cuDNN conv static workspace # Get gallery images # Detect and extract feature of persons in each gallery image # Necessary to warm-up the net, otherwise the first image results are wrong # Don't know ... | 2.058521 | 2 |
sapextractor/utils/objclass_to_tables/get.py | aarkue/sap-meta-explorer | 2 | 6633327 | def apply(con, mandt="800"):
df = con.execute_read_sql("SELECT OBJECTCLAS, Count(*) FROM "+con.table_prefix+"CDHDR WHERE MANDANT = '"+mandt+"' GROUP BY OBJECTCLAS ORDER BY Count(*) DESC", ["OBJECTCLAS", "COUNT"])
df = df.to_dict("r")
df = {str(x["OBJECTCLAS"]): int(x["COUNT"]) for x in df}
return df
| def apply(con, mandt="800"):
df = con.execute_read_sql("SELECT OBJECTCLAS, Count(*) FROM "+con.table_prefix+"CDHDR WHERE MANDANT = '"+mandt+"' GROUP BY OBJECTCLAS ORDER BY Count(*) DESC", ["OBJECTCLAS", "COUNT"])
df = df.to_dict("r")
df = {str(x["OBJECTCLAS"]): int(x["COUNT"]) for x in df}
return df
| none | 1 | 2.872023 | 3 | |
pybind/slxos/v17r_2_00/tm_state/tmcpustatsslot/__init__.py | extremenetworks/pybind | 0 | 6633328 | <reponame>extremenetworks/pybind
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.... | from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from de... | en | 0.501971 | This class was auto-generated by the PythonClass plugin for PYANG from YANG module brocade-sysdiag-operational - based on the path /tm-state/tmcpustatsslot. Each member element of the container is represented as a class variable - with a specific YANG type. YANG Description: TM voq stats for CPU port per slot ... | 1.936999 | 2 |
cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_sysadmin_fpd_infra_cli_fpdserv_ctrace.py | bopopescu/ACI | 0 | 6633329 | <reponame>bopopescu/ACI
""" Cisco_IOS_XR_sysadmin_fpd_infra_cli_fpdserv_ctrace
"""
from collections import OrderedDict
from ydk.types import Entity, EntityPath, Identity, Enum, YType, YLeaf, YLeafList, YList, LeafDataList, Bits, Empty, Decimal64
from ydk.filters import YFilter
from ydk.errors import YError, YModelE... | """ Cisco_IOS_XR_sysadmin_fpd_infra_cli_fpdserv_ctrace
"""
from collections import OrderedDict
from ydk.types import Entity, EntityPath, Identity, Enum, YType, YLeaf, YLeafList, YList, LeafDataList, Bits, Empty, Decimal64
from ydk.filters import YFilter
from ydk.errors import YError, YModelError
from ydk.errors.err... | en | 0.299807 | Cisco_IOS_XR_sysadmin_fpd_infra_cli_fpdserv_ctrace .. attribute:: trace show traceable processes **type**\: list of :py:class:`Trace <ydk.models.cisco_ios_xr.Cisco_IOS_XR_sysadmin_fpd_infra_cli_fpdserv_ctrace.Fpdserv.Trace>` show traceable processes .. attribute:: buffer (key) ... | 1.900437 | 2 |
core/core.py | helloqiu/silly_spider | 2 | 6633330 | <reponame>helloqiu/silly_spider<gh_stars>1-10
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import re
from .bag import *
from .dog import *
class Core:
origin_url = None
url_set = set([])
bag = Bag()
def __init__(self, url):
self.origin_url = url
se... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import re
from .bag import *
from .dog import *
class Core:
origin_url = None
url_set = set([])
bag = Bag()
def __init__(self, url):
self.origin_url = url
self.bag.put(url)
def put(self, links):
... | en | 0.769321 | # -*- coding: utf-8 -*- | 2.710583 | 3 |
src/sage/combinat/crystals/spins.py | bopopescu/sage | 3 | 6633331 | <gh_stars>1-10
r"""
Spin Crystals
These are the crystals associated with the three spin
representations: the spin representations of odd orthogonal groups
(or rather their double covers); and the `+` and `-` spin
representations of the even orthogonal groups.
We follow Kashiwara and Nakashima (Journal of Algebra 165,... | r"""
Spin Crystals
These are the crystals associated with the three spin
representations: the spin representations of odd orthogonal groups
(or rather their double covers); and the `+` and `-` spin
representations of the even orthogonal groups.
We follow Kashiwara and Nakashima (Journal of Algebra 165, 1994) in
repre... | en | 0.583714 | Spin Crystals These are the crystals associated with the three spin representations: the spin representations of odd orthogonal groups (or rather their double covers); and the `+` and `-` spin representations of the even orthogonal groups. We follow Kashiwara and Nakashima (Journal of Algebra 165, 1994) in representi... | 2.527903 | 3 |
python/fate_flow/components/components.py | MiKKiYang/FATE-Flow | 0 | 6633332 | <filename>python/fate_flow/components/components.py
#
# Copyright 2019 The FATE Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.or... | <filename>python/fate_flow/components/components.py
#
# Copyright 2019 The FATE Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.or... | en | 0.848233 | # # Copyright 2019 The FATE Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli... | 1.905975 | 2 |
gcn/gcn_graph/train_search.py | kevin840307/sgas | 161 | 6633333 | <reponame>kevin840307/sgas<gh_stars>100-1000
import __init__
import os
import sys
import time
import glob
import math
import numpy as np
import torch
from gcn import utils
import logging
import argparse
import torch.utils
import torch.nn as nn
import torch.nn.functional as F
import torch_geometric.datasets as GeoData
f... | import __init__
import os
import sys
import time
import glob
import math
import numpy as np
import torch
from gcn import utils
import logging
import argparse
import torch.utils
import torch.nn as nn
import torch.nn.functional as F
import torch_geometric.datasets as GeoData
from torch_geometric.data import DataLoader
im... | en | 0.459158 | # torch_geometric.set_debug(True) # logging.info(type + " importance {}".format(importance)) # print(type + " probs", probs) # logging.info(type + " entropy {}".format(entropy)) # SGAS Cri.2 # logging.info(type + " probs history {}".format(probs_history)) # logging.info(type + " histogram intersection average {}".forma... | 2.06735 | 2 |
sushy/resources/system/storage/volume.py | sapcc/sushy | 0 | 6633334 | <reponame>sapcc/sushy<gh_stars>0
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | en | 0.782738 | # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d... | 2.039316 | 2 |
chart_web.py | caux/japonicus | 0 | 6633335 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import glob
import datetime
import numpy as np
import pandas as pd
import json
import os
import quantmod as qm
import flask
import dash
from dash.dependencies import Input, Output
import dash_core_components as dcc
import dash_html_components as html
from flask_caching im... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import glob
import datetime
import numpy as np
import pandas as pd
import json
import os
import quantmod as qm
import flask
import dash
from dash.dependencies import Input, Output
import dash_core_components as dcc
import dash_html_components as html
from flask_caching im... | en | 0.388671 | #!/usr/bin/env python # -*- coding: utf-8 -*- # from plotInfo import plotEvolutionSummary # dict key rename # add matype # newparams["STOCHRSI"]["matype"] = MA_EMA # Setup the app # server.secret_key = os.environ.get('secret_key', 'secret') # Setup config # Setup chart # Add caching # 1 hour # Controls # Dynamic bindin... | 1.840639 | 2 |
image_labelling_tool/models.py | uea-computer-vision/django-labeller | 4 | 6633336 | import json, datetime
from django.db import models
from django.conf import settings
from django.utils import timezone
from django.contrib.auth import get_user_model
from . import managers
class LabelsLockedError (Exception):
pass
class LabellingTask (models.Model):
enabled = models.BooleanField(default=True... | import json, datetime
from django.db import models
from django.conf import settings
from django.utils import timezone
from django.contrib.auth import get_user_model
from . import managers
class LabelsLockedError (Exception):
pass
class LabellingTask (models.Model):
enabled = models.BooleanField(default=True... | en | 0.841532 | # Label data # Task completion # Creation date # Time elapsed during editing, in seconds # Last modification user and datetime # Locked by user and expiry datetime # Manager Access metadata (completed tasks, creation date, last modified by, last modified date time) as a dict :return: Access metadata (completed ... | 2.238005 | 2 |
examples/example_vanillaFrog.py | omelchert/optfrog | 8 | 6633337 | <filename>examples/example_vanillaFrog.py
"""Script filename: example_vanillaFrog.py
Exemplary calculation of a vanillaFrog trace for data obtained from
the numerical propagation of a short and intense few-cycle optical
pulse in presence of the refractive index profile of an endlessly single
mode photonic crystal fibe... | <filename>examples/example_vanillaFrog.py
"""Script filename: example_vanillaFrog.py
Exemplary calculation of a vanillaFrog trace for data obtained from
the numerical propagation of a short and intense few-cycle optical
pulse in presence of the refractive index profile of an endlessly single
mode photonic crystal fibe... | en | 0.685457 | Script filename: example_vanillaFrog.py Exemplary calculation of a vanillaFrog trace for data obtained from the numerical propagation of a short and intense few-cycle optical pulse in presence of the refractive index profile of an endlessly single mode photonic crystal fiber. # EOF: example_vanillaFrog.py | 2.490702 | 2 |
sets-master/sets-master/sets/core/__init__.py | FedericoMolinaChavez/tesis-research | 0 | 6633338 | <gh_stars>0
from .dataset import Dataset
from .step import Step
from .embedding import Embedding
| from .dataset import Dataset
from .step import Step
from .embedding import Embedding | none | 1 | 1.128216 | 1 | |
plots/figure_7.py | Wookai/online-collaborative-prediction | 3 | 6633339 | import argparse
import plot_utils as pu
def main(args):
n_runs = 10
models = {
'BIAS': [':', 'national_bias_nruns=%d.mat' % (n_runs,)],
'LIN(v)': ['-.', 'national_lin_v_lambda=32_nruns=%d.mat' % (n_runs,)],
'MF + GP(r)': ['--', 'national_mf_gp_r_seard_L=25_nruns=%d.mat' % (n_runs,)],
... | import argparse
import plot_utils as pu
def main(args):
n_runs = 10
models = {
'BIAS': [':', 'national_bias_nruns=%d.mat' % (n_runs,)],
'LIN(v)': ['-.', 'national_lin_v_lambda=32_nruns=%d.mat' % (n_runs,)],
'MF + GP(r)': ['--', 'national_mf_gp_r_seard_L=25_nruns=%d.mat' % (n_runs,)],
... | none | 1 | 2.332414 | 2 | |
dask_yarn/cli.py | thomasjpfan/dask-yarn | 0 | 6633340 | <reponame>thomasjpfan/dask-yarn<gh_stars>0
import argparse
import os
import shutil
import subprocess
import sys
import tempfile
from contextlib import contextmanager
from urllib.parse import urlparse
import skein
from skein.utils import format_table, humanize_timedelta
from tornado.ioloop import IOLoop, TimeoutError
f... | import argparse
import os
import shutil
import subprocess
import sys
import tempfile
from contextlib import contextmanager
from urllib.parse import urlparse
import skein
from skein.utils import format_table, humanize_timedelta
from tornado.ioloop import IOLoop, TimeoutError
from distributed import Scheduler, Nanny
fro... | en | 0.561431 | Format with a fixed argument width, due to bug in argparse measuring argument widths Format remainder arguments nicer # Exposed for testing # deploy_mode == 'remote' # deploy_mode == 'local' Contextmanager for consistent syntax for maybe creating a tempdir # pragma: nocover # module fails importing on Windows # Set... | 1.992444 | 2 |
lib/fasta.py | viadanna/rosalind-python | 0 | 6633341 | <gh_stars>0
from .sequences import DNA
def parse_fasta(lines, _type):
name = None
sequence = ''
for line in lines:
if line.startswith('>'):
if name:
yield DNA(sequence, name)
sequence = ''
name = line[1:]
else:
sequence +=... | from .sequences import DNA
def parse_fasta(lines, _type):
name = None
sequence = ''
for line in lines:
if line.startswith('>'):
if name:
yield DNA(sequence, name)
sequence = ''
name = line[1:]
else:
sequence += line
yi... | none | 1 | 3.520746 | 4 | |
pysper/parser/captures.py | arvy/sperf | 0 | 6633342 | # Copyright 2020 DataStax, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | # Copyright 2020 DataStax, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | en | 0.626612 | # Copyright 2020 DataStax, Inc # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,... | 1.678249 | 2 |
app/api/v2/__init__.py | queenfiona/SendITc3 | 0 | 6633343 | <reponame>queenfiona/SendITc3
"""Docstring for v2's __init__.py."""
from flask import Blueprint
from flask_restful import Api
from .views.user_views import UserRegistration, UserLogin
from .views.parcel_views import (
ParcelOrderView, UserOrderView, AllOrdersView, StatusView, DestinationView,
PresentLocView, C... | """Docstring for v2's __init__.py."""
from flask import Blueprint
from flask_restful import Api
from .views.user_views import UserRegistration, UserLogin
from .views.parcel_views import (
ParcelOrderView, UserOrderView, AllOrdersView, StatusView, DestinationView,
PresentLocView, CancelOrderView)
version_2 = B... | en | 0.480067 | Docstring for v2's __init__.py. | 2.282457 | 2 |
Models/transfer_learning_models.py | isse-augsburg/PermeabilityNets | 1 | 6633344 | <reponame>isse-augsburg/PermeabilityNets
import torch
import torch.nn as nn
class ModelWrapper(nn.Module):
"""
Wrapper for pretrained torchvision models. Changes the last layer.
"""
def __init__(self, model, out_features=1):
super(ModelWrapper, self).__init__()
self.model = model
... | import torch
import torch.nn as nn
class ModelWrapper(nn.Module):
"""
Wrapper for pretrained torchvision models. Changes the last layer.
"""
def __init__(self, model, out_features=1):
super(ModelWrapper, self).__init__()
self.model = model
'''self.model.conv1 = torch.nn.Conv2d(... | en | 0.451073 | Wrapper for pretrained torchvision models. Changes the last layer. self.model.conv1 = torch.nn.Conv2d(1, 64, kernel_size=7, stride=2, padding=3, bias=False) | 3.246609 | 3 |
bootcamp/feeds/models.py | Fadykhallaf/Signet | 0 | 6633345 | from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.html import escape
from django.utils.translation import ugettext_lazy as _
import hashlib
import os
import urllib
from django.conf import settings
from bootcamp import se... | from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.html import escape
from django.utils.translation import ugettext_lazy as _
import hashlib
import os
import urllib
from django.conf import settings
from bootcamp import se... | none | 1 | 2.081829 | 2 | |
yoti_python_sdk/doc_scan/session/retrieve/id_document_resource_response.py | getyoti/python | 9 | 6633346 | <reponame>getyoti/python<filename>yoti_python_sdk/doc_scan/session/retrieve/id_document_resource_response.py
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from yoti_python_sdk.doc_scan.session.retrieve.document_fields_response import (
DocumentFieldsResponse,
)
from yoti_python_sdk.doc_scan.sessi... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from yoti_python_sdk.doc_scan.session.retrieve.document_fields_response import (
DocumentFieldsResponse,
)
from yoti_python_sdk.doc_scan.session.retrieve.document_id_photo_response import (
DocumentIdPhotoResponse,
)
from yoti_python_sdk.doc_scan.... | en | 0.583316 | # -*- coding: utf-8 -*- Represents an Identity Document resource for a given session :param data: the data to parse :type data: dict or None Returns the identity document type, e.g. "PASSPORT" :return: the document type :rtype: str or None Returns the issuing country of the identity document ... | 2.22022 | 2 |
scripts/twice.py | naganoyusuke/file2 | 0 | 6633347 | <filename>scripts/twice.py
#!/usr/bin/env python3
import rospy
from std_msgs.msg import Int32
rospy.init_node('twice')
pub = rospy.Publisher('twice_up',Int32,queue_size=1)
rate = rospy.Rate (20)
n = 0
def cb(message):
pub.publish(message.data*2)
if __name__ =='__main__':
rospy.init_node('twice')
sub = rospy.Subscrib... | <filename>scripts/twice.py
#!/usr/bin/env python3
import rospy
from std_msgs.msg import Int32
rospy.init_node('twice')
pub = rospy.Publisher('twice_up',Int32,queue_size=1)
rate = rospy.Rate (20)
n = 0
def cb(message):
pub.publish(message.data*2)
if __name__ =='__main__':
rospy.init_node('twice')
sub = rospy.Subscrib... | fr | 0.221828 | #!/usr/bin/env python3 | 2.336646 | 2 |
src/magnet/utils/config.py | PrincetonUniversity/PMagnet | 20 | 6633348 | import os
import configparser
class ConfigSection(object):
"""
A thin wrapper over a ConfigParser's SectionProxy object,
that tries to infer the types of values, and makes them available as attributes
Currently int/float/str are supported.
"""
def __init__(self, config, section_proxy):
... | import os
import configparser
class ConfigSection(object):
"""
A thin wrapper over a ConfigParser's SectionProxy object,
that tries to infer the types of values, and makes them available as attributes
Currently int/float/str are supported.
"""
def __init__(self, config, section_proxy):
... | en | 0.846234 | A thin wrapper over a ConfigParser's SectionProxy object, that tries to infer the types of values, and makes them available as attributes Currently int/float/str are supported. # key value dict where the value is typecast to int/float/str # If an environment variable exists with name <CONFIG_NAME>_<SECTION>_<IT... | 2.984348 | 3 |
tests/test_updater.py | tgamauf/git-submodule-autoupdate | 1 | 6633349 | from http import HTTPStatus
import json
import os
import requests
import requests_mock
import unittest
from unittest.mock import MagicMock, patch
import gitsup.update as update
class TestUpdate(unittest.TestCase):
@staticmethod
def _clear_environment():
for k in filter(lambda x: x.startswith("GITSUP"... | from http import HTTPStatus
import json
import os
import requests
import requests_mock
import unittest
from unittest.mock import MagicMock, patch
import gitsup.update as update
class TestUpdate(unittest.TestCase):
@staticmethod
def _clear_environment():
for k in filter(lambda x: x.startswith("GITSUP"... | en | 0.726197 | # These are empty as we use default values here # Github API v3 accept header # Auth header # Test if the config file is handed over to config. # We interrupt the test when the get_config mock is called, as # we aren't interested in running the rest # Test if the token is handed over to config. # We interrupt the test... | 2.41855 | 2 |
src/pilot/PilotModes.py | cornzz/robolab-tud-spring18 | 0 | 6633350 | <gh_stars>0
from enum import unique, IntEnum
@unique
class PilotModes(IntEnum):
# low-level modes
FOLLOW_LINE = 0
CHECK_ISC = 1
CHOOSE_PATH = 2
FOLLOW_LINE_ODO = 5
BLOCKED = 6
# top-level modes
EXPLORE = 3
TARGET = 4
| from enum import unique, IntEnum
@unique
class PilotModes(IntEnum):
# low-level modes
FOLLOW_LINE = 0
CHECK_ISC = 1
CHOOSE_PATH = 2
FOLLOW_LINE_ODO = 5
BLOCKED = 6
# top-level modes
EXPLORE = 3
TARGET = 4 | en | 0.892877 | # low-level modes # top-level modes | 2.201066 | 2 |