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 |
|---|---|---|---|---|---|---|---|---|---|---|
Control/antennaControl.py | jerrydark/antenna-tracking | 1 | 6624151 | import GeneralSettings
from Utility.abstract_process import processAbstract
from Actuator.pitch_servo import PitchServo
from Actuator.yaw_servo import YawServo
from Sensors.imuYaw import imuYaw
from Sensors.imuPitch import imuPitch
from Vehicle.uavInteraction import mavlinkHandler
#from debugger import Debugger
from Se... | import GeneralSettings
from Utility.abstract_process import processAbstract
from Actuator.pitch_servo import PitchServo
from Actuator.yaw_servo import YawServo
from Sensors.imuYaw import imuYaw
from Sensors.imuPitch import imuPitch
from Vehicle.uavInteraction import mavlinkHandler
#from debugger import Debugger
from Se... | en | 0.534621 | #from debugger import Debugger # classes for shared data across multiprocess # compre from utility.multiprocessDataType # self.period = 0.2 # 200 ms of period might not be optimal # processAbstract): #self.debugger = Debugger(self.antenna_data, self.uav_data, self.actuator_setpoint) # time.sleep(1) # se... | 2.419542 | 2 |
aiexplore/rls500/helper.py | kglavin/lunarip | 0 | 6624152 | <filename>aiexplore/rls500/helper.py
import matplotlib.pyplot as plt
from IPython import display
#derived from https://github.com/python-engineer/snake-ai-pytorch
plt.ion()
def plot_init(title):
##display.clear_output(wait=True)
#display.display(plt.gcf())
##plt.clf()
#plt.title(title)
#plt.figur... | <filename>aiexplore/rls500/helper.py
import matplotlib.pyplot as plt
from IPython import display
#derived from https://github.com/python-engineer/snake-ai-pytorch
plt.ion()
def plot_init(title):
##display.clear_output(wait=True)
#display.display(plt.gcf())
##plt.clf()
#plt.title(title)
#plt.figur... | en | 0.22376 | #derived from https://github.com/python-engineer/snake-ai-pytorch ##display.clear_output(wait=True) #display.display(plt.gcf()) ##plt.clf() #plt.title(title) #plt.figure() #_ = plt.plot(scores) #_ = plt.plot(mean_scores) #ax1.set_ylim(ymin=0,ymax=60) #_ = plt.plot(model_scores) #ax2.set_ylim(ymin=0,ymax=5000) #ax3.set_... | 3.085175 | 3 |
lib/python/treadmill/appcfg/features/docker.py | krcooke/treadmill | 133 | 6624153 | """Configures dockerd inside the container.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
from treadmill import dockerutils
from treadmill import nodedata
from treadmill import subproc
from tread... | """Configures dockerd inside the container.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
from treadmill import dockerutils
from treadmill import nodedata
from treadmill import subproc
from tread... | en | 0.784467 | Configures dockerd inside the container. Feature to enabled docker daemon in container # TODO: we need to move dockerd and docker authz to system-services # when they are stable # get registry address from node.json # full command include creating rest module cfg file and launch sproc Configure docker daemon services. ... | 1.962025 | 2 |
driver.py | kyclark/python_plugins | 0 | 6624154 | <gh_stars>0
#!/usr/bin/env python3
"""Run function from imported module"""
import argparse
import importlib
import os
import pkgutil
from typing import NamedTuple, Callable, Dict
class Args(NamedTuple):
language: str
name: str
# --------------------------------------------------
def get_args(plugins: Dict[... | #!/usr/bin/env python3
"""Run function from imported module"""
import argparse
import importlib
import os
import pkgutil
from typing import NamedTuple, Callable, Dict
class Args(NamedTuple):
language: str
name: str
# --------------------------------------------------
def get_args(plugins: Dict[str, Callabl... | en | 0.172707 | #!/usr/bin/env python3 Run function from imported module # -------------------------------------------------- Get command-line arguments # -------------------------------------------------- Make a jazz noise here # -------------------------------------------------- | 3.116658 | 3 |
tests/validators/test_global_maps.py | YVautrin/xmlschema | 95 | 6624155 | <filename>tests/validators/test_global_maps.py
#!/usr/bin/env python
#
# Copyright (c), 2016-2020, SISSA (International School for Advanced Studies).
# All rights reserved.
# This file is distributed under the terms of the MIT License.
# See the file 'LICENSE' in the root directory of the present
# distribution, or htt... | <filename>tests/validators/test_global_maps.py
#!/usr/bin/env python
#
# Copyright (c), 2016-2020, SISSA (International School for Advanced Studies).
# All rights reserved.
# This file is distributed under the terms of the MIT License.
# See the file 'LICENSE' in the root directory of the present
# distribution, or htt... | en | 0.748873 | #!/usr/bin/env python # # Copyright (c), 2016-2020, SISSA (International School for Advanced Studies). # All rights reserved. # This file is distributed under the terms of the MIT License. # See the file 'LICENSE' in the root directory of the present # distribution, or http://opensource.org/licenses/MIT. # # @author <N... | 2.302317 | 2 |
samples/sample_as_decorator.py | fabiofenoglio/py-load-limiter | 0 | 6624156 | import time
import random
import logging
from pyloadlimiter import LoadLimiter
logging.basicConfig(format='%(asctime)s %(threadName)s [%(name)s %(levelname)s] %(message)s', level=logging.DEBUG)
limiter = LoadLimiter(name='TestQueue80in20', maxload=80, period=20)
@limiter()
def do_things():
logging.info('doing th... | import time
import random
import logging
from pyloadlimiter import LoadLimiter
logging.basicConfig(format='%(asctime)s %(threadName)s [%(name)s %(levelname)s] %(message)s', level=logging.DEBUG)
limiter = LoadLimiter(name='TestQueue80in20', maxload=80, period=20)
@limiter()
def do_things():
logging.info('doing th... | none | 1 | 2.583811 | 3 | |
data/f_mnist_data.py | duyndh/PixelDefend | 18 | 6624157 | <gh_stars>10-100
# Copyright (c) Microsoft Corporation. Licensed under the MIT license.
import os
import numpy as np
from tensorflow.examples.tutorials.mnist import input_data
def load_data(data_dir, subset):
if subset == 'train':
mnist_data = input_data.read_data_sets(data_dir)
data, labels = mn... | # Copyright (c) Microsoft Corporation. Licensed under the MIT license.
import os
import numpy as np
from tensorflow.examples.tutorials.mnist import input_data
def load_data(data_dir, subset):
if subset == 'train':
mnist_data = input_data.read_data_sets(data_dir)
data, labels = mnist_data.train.im... | en | 0.818301 | # Copyright (c) Microsoft Corporation. Licensed under the MIT license. - data_dir is location where to store files - subset is train|test - batch_size is int, of #examples to load at once - rng is np.random.RandomState object for reproducibility # create temporary storage for the data, if not y... | 3.053076 | 3 |
test/time_radius_batch.py | humanpose1/torch_radius_neighbors | 1 | 6624158 | # Goal: compare different implementation to see which one is faster
import torch
import matplotlib.pyplot as plt
import numpy as np
import neighbors
import time
from scipy.spatial import cKDTree
def compute_batch_radius_with_scipy(x, y, batch_x, batch_y, radius):
x_ = torch.cat([x, 2 * radius * batch_x.view(-1,... | # Goal: compare different implementation to see which one is faster
import torch
import matplotlib.pyplot as plt
import numpy as np
import neighbors
import time
from scipy.spatial import cKDTree
def compute_batch_radius_with_scipy(x, y, batch_x, batch_y, radius):
x_ = torch.cat([x, 2 * radius * batch_x.view(-1,... | en | 0.901472 | # Goal: compare different implementation to see which one is faster # generate a random batch | 2.818028 | 3 |
tailpos_sync/sync_pos.py | iRaySpace/tailpos-sync | 1 | 6624159 | from sync_methods import *
import frappe
import datetime
@frappe.whitelist()
def pull_data(data):
query = "SELECT name FROM `tab{0}`".format(data['doctype'])
if data['doctype'] == "Item":
query = "SELECT name, description, standard_rate FROM `tabItem` WHERE disabled=0"
# Getting the resources
... | from sync_methods import *
import frappe
import datetime
@frappe.whitelist()
def pull_data(data):
query = "SELECT name FROM `tab{0}`".format(data['doctype'])
if data['doctype'] == "Item":
query = "SELECT name, description, standard_rate FROM `tabItem` WHERE disabled=0"
# Getting the resources
... | en | 0.874316 | # Getting the resources #Check if there is Each and Weight in UOM #Check if there are latest deleted records #Delete records # Check if record is existing in deleted documents #Add receipt lines #Check modified time #Insert data #Fetch all data in ERPNext for selected tables #Fetch Updated or Added data in ERPNext for ... | 2.319527 | 2 |
formlibrary/migrations/0002_auto_20171019_0107.py | sannleen/TolaActivity | 0 | 6624160 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-10-19 08:07
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('formlibrary', '0001_initial'),
... | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-10-19 08:07
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('formlibrary', '0001_initial'),
... | en | 0.751956 | # -*- coding: utf-8 -*- # Generated by Django 1.11.3 on 2017-10-19 08:07 | 1.456043 | 1 |
datasets/convert_dataset/generate_density_map.py | ZJU-lishuang/C-3-Framework | 0 | 6624161 | <reponame>ZJU-lishuang/C-3-Framework
#-*-encoding: utf-8 -*-
import glob
import os
import os.path as path
from PIL import Image
import scipy.io as scio
import numpy as np
import scipy.ndimage
import pickle
from tqdm import tqdm
import pdb
import json
import cv2
# gauss kernel
def gen_gauss_kernels(kernel_size=15, sig... | #-*-encoding: utf-8 -*-
import glob
import os
import os.path as path
from PIL import Image
import scipy.io as scio
import numpy as np
import scipy.ndimage
import pickle
from tqdm import tqdm
import pdb
import json
import cv2
# gauss kernel
def gen_gauss_kernels(kernel_size=15, sigma=4):
kernel_shape = (kernel_si... | en | 0.437501 | #-*-encoding: utf-8 -*- # gauss kernel Fast gaussian filter implementation : using precomputed distances and kernels #print(point_x, point_y) #print(min_img_x, min_img_y, max_img_x, max_img_y) #print(kernel_x_max, kernel_x_min, kernel_y_max, kernel_y_min) # ShanghaiTech_A # ShanghaiTech_B # UCF-QNRF # UCF-CC-50 # Shang... | 2.334446 | 2 |
nepal_forex/conf.py | sbishnu019/nepal-forex | 1 | 6624162 | from nepal_forex.datasets import CURRENCY_DATA
NRB_API = 'https://archive.nrb.org.np/exportForexJSON.php'
SUPPORTED_CURRENCIES = [
key for key in CURRENCY_DATA.keys()
]
| from nepal_forex.datasets import CURRENCY_DATA
NRB_API = 'https://archive.nrb.org.np/exportForexJSON.php'
SUPPORTED_CURRENCIES = [
key for key in CURRENCY_DATA.keys()
]
| none | 1 | 1.475188 | 1 | |
tests/test_process_data.py | fluothunder/data-in-python | 0 | 6624163 | <reponame>fluothunder/data-in-python<filename>tests/test_process_data.py
from pandas._testing import assert_frame_equal
import psda.process.process_data
from variables_for_test_process_data import *
def test_create_dict_of_districts():
new_dict = psda.process.process_data.create_dict_of_districts(df1)
# compa... | from pandas._testing import assert_frame_equal
import psda.process.process_data
from variables_for_test_process_data import *
def test_create_dict_of_districts():
new_dict = psda.process.process_data.create_dict_of_districts(df1)
# compare to expected_dict1:
assert new_dict.keys() == expected_dict1.keys()... | en | 0.873869 | # compare to expected_dict1: | 2.525064 | 3 |
attys-scope/ecg_analysis.py | glasgowneuro/attys-python-examples | 1 | 6624164 | import numpy as np
from scipy import signal as signal
"""
ECG R-peak detector and heart rate detector
The detector uses the matched filter approach by creating
an IIR bandpass filter which looks like an R peak and
thus is a recursive matched filter. One could also say
it's a causal wavelet or perhaps just a band... | import numpy as np
from scipy import signal as signal
"""
ECG R-peak detector and heart rate detector
The detector uses the matched filter approach by creating
an IIR bandpass filter which looks like an R peak and
thus is a recursive matched filter. One could also say
it's a causal wavelet or perhaps just a band... | en | 0.915713 | ECG R-peak detector and heart rate detector The detector uses the matched filter approach by creating an IIR bandpass filter which looks like an R peak and thus is a recursive matched filter. One could also say it's a causal wavelet or perhaps just a bandpass filter which covers the frequency range of the R peak.... | 3.443749 | 3 |
mvnx/__init__.py | edscher/mvnx | 7 | 6624165 | import numpy as np
from mvnx.models import MVNX
import argparse
import errno
import os
import warnings
import traceback
def load(*args, **kwargs):
return MVNX(*args, **kwargs)
def main():
parser = argparse.ArgumentParser()
parser.add_argument("-f", "--file", help="the MVNX file to parse")
parser.add_... | import numpy as np
from mvnx.models import MVNX
import argparse
import errno
import os
import warnings
import traceback
def load(*args, **kwargs):
return MVNX(*args, **kwargs)
def main():
parser = argparse.ArgumentParser()
parser.add_argument("-f", "--file", help="the MVNX file to parse")
parser.add_... | none | 1 | 2.251492 | 2 | |
features/hooks/trie.py | caktux/pyethereum | 1 | 6624166 | import os
from os import path
class TrieHook(object):
db_dir = "tmp"
db_file_name = "trie-test.db"
def __init__(self):
self.db_path = path.join(self.db_dir, self.db_file_name)
def before_feature(self, context, feature):
from pyethereum import trie
self._create_dir()
s... | import os
from os import path
class TrieHook(object):
db_dir = "tmp"
db_file_name = "trie-test.db"
def __init__(self):
self.db_path = path.join(self.db_dir, self.db_file_name)
def before_feature(self, context, feature):
from pyethereum import trie
self._create_dir()
s... | none | 1 | 2.227122 | 2 | |
colortest.py | IGBC/scripts | 0 | 6624167 | <reponame>IGBC/scripts<gh_stars>0
#!/usr/bin/env python
import sys
write = sys.stdout.write
for i in range(40, 49):
for j in range(30, 39):
for k in range(0, 10):
write("\33[%d;%d;%dm%d;%d;%d\33[m " % (k, j, i, k, j, i))
write("\n")
write("\n")
| #!/usr/bin/env python
import sys
write = sys.stdout.write
for i in range(40, 49):
for j in range(30, 39):
for k in range(0, 10):
write("\33[%d;%d;%dm%d;%d;%d\33[m " % (k, j, i, k, j, i))
write("\n")
write("\n") | ru | 0.26433 | #!/usr/bin/env python | 2.775143 | 3 |
run_docs.py | fvbehr/cmdx | 128 | 6624168 | """Run each example in the README as a doctest"""
| """Run each example in the README as a doctest"""
| en | 0.91144 | Run each example in the README as a doctest | 1.265596 | 1 |
actions/formatters.py | seekM/talon_new_api_starter_pack | 1 | 6624169 | from talon import Module, Context, actions, ui
from talon.voice import Capture
from ..utils import sentence_text, text, parse_word, parse_words
ctx = Context()
key = actions.key
words_to_keep_lowercase = "a,an,the,at,by,for,in,is,of,on,to,up,and,as,but,or,nor".split(",")
def surround(by):
def func(i, word, last)... | from talon import Module, Context, actions, ui
from talon.voice import Capture
from ..utils import sentence_text, text, parse_word, parse_words
ctx = Context()
key = actions.key
words_to_keep_lowercase = "a,an,the,at,by,for,in,is,of,on,to,up,and,as,but,or,nor".split(",")
def surround(by):
def func(i, word, last)... | en | 0.27142 | # True -> no separator Sentence formatter text formatter | 2.954164 | 3 |
Iniciante-Begginer/Python/#1051 - #1100/#1071-SomaDeImparesConsecutivosI.py | jocelinoFG017/Beecrowd-judge-solutions | 2 | 6624170 | <filename>Iniciante-Begginer/Python/#1051 - #1100/#1071-SomaDeImparesConsecutivosI.py
X = int(input())
Y = int(input())
soma = 0
if X % 2 == 0:
for i in range(X, Y, -1):
if i % 2 != 0:
soma = soma + i
else:
X -= 1
for i in range(X, Y, -1):
if i % 2 != 0:
soma = soma +... | <filename>Iniciante-Begginer/Python/#1051 - #1100/#1071-SomaDeImparesConsecutivosI.py
X = int(input())
Y = int(input())
soma = 0
if X % 2 == 0:
for i in range(X, Y, -1):
if i % 2 != 0:
soma = soma + i
else:
X -= 1
for i in range(X, Y, -1):
if i % 2 != 0:
soma = soma +... | es | 0.262093 | #1051 - #1100/#1071-SomaDeImparesConsecutivosI.py | 3.524248 | 4 |
test.py | NPS-Cisco-2019/OCR | 0 | 6624171 | import argparse
import os
import time
import cv2 as cv;
from nms import nms;
from math import degrees, sin, cos
from matplotlib import pyplot as plt
import numpy as np
from config import *
from text_from_im import text_from_image_path
initLog()
for i in range(1, 100):
try:
log(f'[{i}]')
image_pat... | import argparse
import os
import time
import cv2 as cv;
from nms import nms;
from math import degrees, sin, cos
from matplotlib import pyplot as plt
import numpy as np
from config import *
from text_from_im import text_from_image_path
initLog()
for i in range(1, 100):
try:
log(f'[{i}]')
image_pat... | none | 1 | 2.225598 | 2 | |
original-client/dike/__init__.py | earaujoassis/knock-knock | 2 | 6624172 | <filename>original-client/dike/__init__.py<gh_stars>1-10
# -*- coding: utf-8 -*-
from .settings import *
from .errors import *
from .network_info import get_remote_ip, get_local_ip
from .remote_server import revise_domain_entry
| <filename>original-client/dike/__init__.py<gh_stars>1-10
# -*- coding: utf-8 -*-
from .settings import *
from .errors import *
from .network_info import get_remote_ip, get_local_ip
from .remote_server import revise_domain_entry
| en | 0.769321 | # -*- coding: utf-8 -*- | 1.297008 | 1 |
xcffibaer_lib/__init__.py | whitelynx/xcffibaer | 1 | 6624173 | <reponame>whitelynx/xcffibaer<filename>xcffibaer_lib/__init__.py
'''A themeable status bar written in Python, using xcffib.
'''
from . import chunks
from .Bar import Bar
from .FSReader import FSReader
from .Store import Store
from .Window import Window
from .XSetup import XSetup
__all__ = ['chunks', 'Bar', 'FSReader... | '''A themeable status bar written in Python, using xcffib.
'''
from . import chunks
from .Bar import Bar
from .FSReader import FSReader
from .Store import Store
from .Window import Window
from .XSetup import XSetup
__all__ = ['chunks', 'Bar', 'FSReader', 'Store', 'Window', 'XSetup'] | en | 0.690795 | A themeable status bar written in Python, using xcffib. | 1.604029 | 2 |
incasem/torch/loss/cross_entropy_loss_debug.py | kirchhausenlab/incasem | 0 | 6624174 | import logging
import torch
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
class CrossEntropyLossDebug(torch.nn.CrossEntropyLoss):
# def __init__(self):
# super().__init__(reduction="none")
def forward(self, input, target):
logger.debug(f'{float(input.sum())=}')
logg... | import logging
import torch
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
class CrossEntropyLossDebug(torch.nn.CrossEntropyLoss):
# def __init__(self):
# super().__init__(reduction="none")
def forward(self, input, target):
logger.debug(f'{float(input.sum())=}')
logg... | en | 0.295921 | # def __init__(self): # super().__init__(reduction="none") # return torch.mean(loss) | 2.484581 | 2 |
classifier.py | americast/glow-pytorch | 1 | 6624175 | """Train script.
Usage:
infer_celeba.py <hparams> <dataset_root> <z_dir>
"""
import os
import cv2
import random
import torch
import vision
import numpy as np
from docopt import docopt
from torchvision import transforms
from glow.builder import build
from glow.config import JsonConfig
from glow.utils import load
fr... | """Train script.
Usage:
infer_celeba.py <hparams> <dataset_root> <z_dir>
"""
import os
import cv2
import random
import torch
import vision
import numpy as np
from docopt import docopt
from torchvision import transforms
from glow.builder import build
from glow.config import JsonConfig
from glow.utils import load
fr... | en | 0.392543 | Train script. Usage: infer_celeba.py <hparams> <dataset_root> <z_dir> # cv2.imshow("img", img) # cv2.waitKey() Epsilon is used here to avoid conditional code for checking that neither P nor Q is equal to 0. # You may want to instead make copies to avoid changing the np arrays. # P = P+epsilon # Q = Q+epsilon ... | 2.137887 | 2 |
program_synthesis/algolisp/dataset/code_base.py | kavigupta/program_synthesis | 123 | 6624176 | <reponame>kavigupta/program_synthesis
import six
import copy
import math
class MetaNode(type):
node_types = {}
attr_types = set()
def __new__(mcls, name, bases, dct):
attrs = list(dct.get('attrs', {}))
for attr, _, _ in attrs:
mcls.attr_types.add(attr)
dct['attrs'] = ... | import six
import copy
import math
class MetaNode(type):
node_types = {}
attr_types = set()
def __new__(mcls, name, bases, dct):
attrs = list(dct.get('attrs', {}))
for attr, _, _ in attrs:
mcls.attr_types.add(attr)
dct['attrs'] = []
for base in bases:
... | none | 1 | 2.823328 | 3 | |
examples/imdb_id.py | frrmack/googlesearch | 31 | 6624177 | from googlesearch import GoogleSearch
def imdb_id_for_movie(movie_name):
"""Retrieve the imdb id for a movie
from the name (and year if there are remakes)"""
query = 'site:imdb.com %s' % movie_name
url = GoogleSearch( query ).top_url()
import re
imdb_id = re.search('/tt[0-9]+/', url).group(0).... | from googlesearch import GoogleSearch
def imdb_id_for_movie(movie_name):
"""Retrieve the imdb id for a movie
from the name (and year if there are remakes)"""
query = 'site:imdb.com %s' % movie_name
url = GoogleSearch( query ).top_url()
import re
imdb_id = re.search('/tt[0-9]+/', url).group(0).... | en | 0.747431 | Retrieve the imdb id for a movie from the name (and year if there are remakes) | 3.694204 | 4 |
chord/__init__.py | dobisel/postmin | 0 | 6624178 | from .rollup import app
from . import song
from . import artist
from . import index
__version__ = '0.1.0'
| from .rollup import app
from . import song
from . import artist
from . import index
__version__ = '0.1.0'
| none | 1 | 1.175557 | 1 | |
multitask_test.py | Jontahan/kvad | 0 | 6624179 | import numpy as np
from gw_collect import Gridworld
import pygame as pg
import numpy as np
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
import torch.nn.functional as F
from copy import deepcopy
from vicero.algorithms.deepqlearning import DQN
from multitask_env import MultitaskEnvironment
import... | import numpy as np
from gw_collect import Gridworld
import pygame as pg
import numpy as np
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
import torch.nn.functional as F
from copy import deepcopy
from vicero.algorithms.deepqlearning import DQN
from multitask_env import MultitaskEnvironment
import... | en | 0.073983 | #return self.linreg(x) | 2.443635 | 2 |
custom_components/electrolux_status/const.py | tomeko12/homeassistant_electrolux_status | 17 | 6624180 | <filename>custom_components/electrolux_status/const.py
"""The electrolux Status constants."""
# Base component constants
NAME = "Elettrolux status"
DOMAIN = "electrolux_status"
DOMAIN_DATA = f"{DOMAIN}_data"
# Icons
ICON = "mdi:format-quote-close"
# Device classes
BINARY_SENSOR_DEVICE_CLASS = "connectivity"
# Platfo... | <filename>custom_components/electrolux_status/const.py
"""The electrolux Status constants."""
# Base component constants
NAME = "Elettrolux status"
DOMAIN = "electrolux_status"
DOMAIN_DATA = f"{DOMAIN}_data"
# Icons
ICON = "mdi:format-quote-close"
# Device classes
BINARY_SENSOR_DEVICE_CLASS = "connectivity"
# Platfo... | en | 0.583246 | The electrolux Status constants. # Base component constants # Icons # Device classes # Platforms # Configuration and options # Defaults | 1.590289 | 2 |
Tensorflow_network/seq2SeqSummarisation.py | quilan78/MSC_project | 0 | 6624181 | import tensorflow as tf
import numpy as np
import time
import sys
sys.path.append('/home/dwt17/MSc_project/neural_sum_1/code/Commons/')
sys.path.append('../Commons/')
from read_data import *
from vocab import *
from treatedData import *
from LRP_output import *
from batch import *
from model import *
import... | import tensorflow as tf
import numpy as np
import time
import sys
sys.path.append('/home/dwt17/MSc_project/neural_sum_1/code/Commons/')
sys.path.append('../Commons/')
from read_data import *
from vocab import *
from treatedData import *
from LRP_output import *
from batch import *
from model import *
import... | en | 0.453774 | #Initialising the Model #Training variables #Data loader #For testing on CPU #os.environ["CUDA_VISIBLE_DEVICES"]="-1" # Blocks the execution to only one CPU #with tf.Session() as sess: #print(tf.trainable_variables()) #For tensorboard #batch_loader.load_object(4) #Training variables # Blocks the execution to only one C... | 2.187162 | 2 |
tools/perf/core/external_modules.py | zealoussnow/chromium | 14,668 | 6624182 | # Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Allow importing external modules which may be missing in some platforms.
These modules are normally provided by the vpython environment manager. But
some... | # Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Allow importing external modules which may be missing in some platforms.
These modules are normally provided by the vpython environment manager. But
some... | en | 0.744731 | # Copyright 2019 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. Allow importing external modules which may be missing in some platforms. These modules are normally provided by the vpython environment manager. But some pla... | 2.368362 | 2 |
script.py | SombiriX/csvcompare | 0 | 6624183 | import csv
LINES_CSV = 'lines.csv'
MVR_CSV = 'mvr.csv'
OUT_CSV = 'out.csv'
WORD_LEN = 4
INJURY_WORDS = ['injury', 'fatal', 'pi', 'homicide', 'death']
with open(OUT_CSV, 'w', newline='') as out_csvfile:
fieldnames = ['svc_code', 'description', 'augusta_risk_type', 'bodily_injury']
writer = csv.DictWriter(out_... | import csv
LINES_CSV = 'lines.csv'
MVR_CSV = 'mvr.csv'
OUT_CSV = 'out.csv'
WORD_LEN = 4
INJURY_WORDS = ['injury', 'fatal', 'pi', 'homicide', 'death']
with open(OUT_CSV, 'w', newline='') as out_csvfile:
fieldnames = ['svc_code', 'description', 'augusta_risk_type', 'bodily_injury']
writer = csv.DictWriter(out_... | en | 0.753603 | # Add line index to outputs for this row | 2.949727 | 3 |
celery_tasks/sms/tasks.py | fightingfish008/tornado-extensions | 5 | 6624184 | import json
import logging
import uuid
from celery_tasks.main import celery_app
from celery_tasks.sms.dysms_python.demo_sms_send import send_sms
# 获取日志器
logger = logging.getLogger('myapp')
# 阿里云发送短信验证码
@celery_app.task(name='send_sms_code')
def send_sms_code(mobile, sms_code):
logger.info(sms_code)
__busines... | import json
import logging
import uuid
from celery_tasks.main import celery_app
from celery_tasks.sms.dysms_python.demo_sms_send import send_sms
# 获取日志器
logger = logging.getLogger('myapp')
# 阿里云发送短信验证码
@celery_app.task(name='send_sms_code')
def send_sms_code(mobile, sms_code):
logger.info(sms_code)
__busines... | zh | 0.789269 | # 获取日志器 # 阿里云发送短信验证码 | 2.126781 | 2 |
setup.py | LABSN/TDTpy | 5 | 6624185 | from os import path
from setuptools import setup
CLASSIFIERS = [
'Development Status :: 4 - Beta',
'Intended Audience :: Science/Research',
'Programming Language :: Python',
'Topic :: Scientific/Engineering',
'Topic :: System :: Hardware',
'License :: OSI Approved'
]
here = path.di... | from os import path
from setuptools import setup
CLASSIFIERS = [
'Development Status :: 4 - Beta',
'Intended Audience :: Science/Research',
'Programming Language :: Python',
'Topic :: Scientific/Engineering',
'Topic :: System :: Hardware',
'License :: OSI Approved'
]
here = path.di... | en | 0.715033 | Source code: http://github.com/LABSN/tdtpy
Documentation: http://tdtpy.readthedocs.org # get the version (don't import tdt here, so dependencies are not needed) | 1.692637 | 2 |
login/migrations/0009_auto_20151115_1859.py | mdsafwan/Deal-My-Stuff | 0 | 6624186 | <filename>login/migrations/0009_auto_20151115_1859.py
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('login', '0008_user_login_status'),
]
operations = [
migrations.AlterFi... | <filename>login/migrations/0009_auto_20151115_1859.py
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('login', '0008_user_login_status'),
]
operations = [
migrations.AlterFi... | en | 0.769321 | # -*- coding: utf-8 -*- | 1.379103 | 1 |
django_ini_settings/load.py | sebastianphelps/django-local-settings | 1 | 6624187 | """Load settings from a file to insert into your django settings.py"""
import ConfigParser
import os
from statics import ANY, NAME_TO_UPPER
from settings_types import (DictItemSetting, StringSetting,
BoolSetting, IntSetting)
CONFIG_FILE_MAPPING = {
("database", "user"): DictItemSettin... | """Load settings from a file to insert into your django settings.py"""
import ConfigParser
import os
from statics import ANY, NAME_TO_UPPER
from settings_types import (DictItemSetting, StringSetting,
BoolSetting, IntSetting)
CONFIG_FILE_MAPPING = {
("database", "user"): DictItemSettin... | en | 0.412406 | Load settings from a file to insert into your django settings.py Find a setting in the config mapping based of the section and option in the config. First search for the exact match of section+option. Then look for section+ANY. # Exact match # Match section with any option Load an ini file into your django sett... | 2.823797 | 3 |
azurelinuxagent/common/cgroupstelemetry.py | deathly809/WALinuxAgent | 0 | 6624188 | # Copyright 2018 Microsoft Corporation
#
# 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... | # Copyright 2018 Microsoft Corporation
#
# 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... | en | 0.884439 | # Copyright 2018 Microsoft Corporation # # 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... | 1.852029 | 2 |
source/infrastructure/quicksight/template_source.py | aws-solutions/improving-forecast-accuracy-with-machine-learning | 3 | 6624189 | # #####################################################################################################################
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# ... | # #####################################################################################################################
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# ... | en | 0.500207 | # ##################################################################################################################### # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # # ... | 1.814725 | 2 |
datasets/flickr/label_finder.py | TimK1998/SemanticSynthesisForScoreBasedModels | 0 | 6624190 | import os
from PIL import Image
import torchvision.transforms.functional as F
from collections import defaultdict
import torch
def find_labels():
data_csv = 'flickr_landscapes_train_split.txt'
targets_dir = '/export/data/compvis/datasets/rfw/segmentation/flickr_segmentation_v2/'
targets = []
with ope... | import os
from PIL import Image
import torchvision.transforms.functional as F
from collections import defaultdict
import torch
def find_labels():
data_csv = 'flickr_landscapes_train_split.txt'
targets_dir = '/export/data/compvis/datasets/rfw/segmentation/flickr_segmentation_v2/'
targets = []
with ope... | none | 1 | 2.63405 | 3 | |
setup.py | abdala9512/auto-MLU | 0 | 6624191 | <reponame>abdala9512/auto-MLU
from setuptools import find_packages, setup
setup(
name='auto-mlu',
packages=find_packages(include=['automlu']),
version='0.3.0',
description='Utilities for Machine learning development',
author='<NAME>',
license='MIT',
install_requires=["scikit-learn"],
se... | from setuptools import find_packages, setup
setup(
name='auto-mlu',
packages=find_packages(include=['automlu']),
version='0.3.0',
description='Utilities for Machine learning development',
author='<NAME>',
license='MIT',
install_requires=["scikit-learn"],
setup_requires=['pytest-runner']... | none | 1 | 1.112359 | 1 | |
crest/filing/midi/__init__.py | yokaze/crest-python | 0 | 6624192 | <reponame>yokaze/crest-python<filename>crest/filing/midi/__init__.py
#
# __init__.py
# crest-python
#
# Copyright (C) 2017 <NAME>
# Distributed under the MIT License.
#
from crest.filing.midi import chunk
from crest.filing.midi import track
__all__ = [
chunk.__name__.split('.')[-1],
track.__name__.spli... | #
# __init__.py
# crest-python
#
# Copyright (C) 2017 <NAME>
# Distributed under the MIT License.
#
from crest.filing.midi import chunk
from crest.filing.midi import track
__all__ = [
chunk.__name__.split('.')[-1],
track.__name__.split('.')[-1]
] | en | 0.517227 | # # __init__.py # crest-python # # Copyright (C) 2017 <NAME> # Distributed under the MIT License. # | 1.472269 | 1 |
peak/peak.py | VanNostrandLab/peak | 0 | 6624193 | <filename>peak/peak.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Pipeline for using IDR to identify a set of reproducible peaks given eClIP dataset with two or three replicates.
"""
import os
import sys
import math
import argparse
import itertools
from subprocess import DEVNULL
import cmder
import inflect
im... | <filename>peak/peak.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Pipeline for using IDR to identify a set of reproducible peaks given eClIP dataset with two or three replicates.
"""
import os
import sys
import math
import argparse
import itertools
from subprocess import DEVNULL
import cmder
import inflect
im... | en | 0.599077 | #!/usr/bin/env python # -*- coding: utf-8 -*- Pipeline for using IDR to identify a set of reproducible peaks given eClIP dataset with two or three replicates. # df = df[(df.l2fc >= options.l2fc) & (df.l10p >= options.l10p)] # For IDR 2.0.2, columns 'excess_reads', 'pi', and 'qi' need to be excluded for .entropy.bed # F... | 2.666365 | 3 |
python/blazingdb/messages/blazingdb/protocol/interpreter/ExecutePlanResponse.py | HubBucket-Team/blazingdb-protocol | 1 | 6624194 | <gh_stars>1-10
# automatically generated by the FlatBuffers compiler, do not modify
# namespace: interpreter
import flatbuffers
class ExecutePlanResponse(object):
__slots__ = ['_tab']
@classmethod
def GetRootAsExecutePlanResponse(cls, buf, offset):
n = flatbuffers.encode.Get(flatbuffers.packer.u... | # automatically generated by the FlatBuffers compiler, do not modify
# namespace: interpreter
import flatbuffers
class ExecutePlanResponse(object):
__slots__ = ['_tab']
@classmethod
def GetRootAsExecutePlanResponse(cls, buf, offset):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, of... | en | 0.55727 | # automatically generated by the FlatBuffers compiler, do not modify # namespace: interpreter # ExecutePlanResponse # ExecutePlanResponse # ExecutePlanResponse | 2.069959 | 2 |
backend/tests/test_password_reset_requests.py | fjacob21/mididecweb | 0 | 6624195 | <reponame>fjacob21/mididecweb
from datetime import datetime
import pytz
from src.stores import MemoryStore
from src.passwordresetrequests import PasswordResetRequests
def generate_request(passwordresetrequests):
r = passwordresetrequests.add('username', 'email')
return r
def test_add():
store = MemorySt... | from datetime import datetime
import pytz
from src.stores import MemoryStore
from src.passwordresetrequests import PasswordResetRequests
def generate_request(passwordresetrequests):
r = passwordresetrequests.add('username', 'email')
return r
def test_add():
store = MemoryStore()
passwordresetrequest... | none | 1 | 2.546816 | 3 | |
server/connections.py | jrburga/JamOn | 0 | 6624196 | import sys
import logging
import time
import socket
from messages import *
from urllib2 import urlopen
IP = '0.0.0.0'
try:
PUBLIC = urlopen('http://ip.42.pl/raw').read()
except:
PUBLIC = '0.0.0.0'
PORT = 21385
MAX_CONNS = 20
TIMEOUT = 10
MSG_SIZE = 2**10
class Connection(object):
def __init__(self, connection, ... | import sys
import logging
import time
import socket
from messages import *
from urllib2 import urlopen
IP = '0.0.0.0'
try:
PUBLIC = urlopen('http://ip.42.pl/raw').read()
except:
PUBLIC = '0.0.0.0'
PORT = 21385
MAX_CONNS = 20
TIMEOUT = 10
MSG_SIZE = 2**10
class Connection(object):
def __init__(self, connection, ... | en | 0.849206 | receive any number of messages at a given time blocking | 2.920888 | 3 |
condition.py | StevenVanDijk/bridgeBiddingBuddy | 0 | 6624197 | <reponame>StevenVanDijk/bridgeBiddingBuddy<gh_stars>0
from typing import List
from bidding import Bidding
infinite : int = 1000
class Condition:
def eval(self, bidding: Bidding) -> bool:
pass
def explain(self) -> str:
pass
class NoBidsMadeCondition(Condition):
def __init__(self):
... | from typing import List
from bidding import Bidding
infinite : int = 1000
class Condition:
def eval(self, bidding: Bidding) -> bool:
pass
def explain(self) -> str:
pass
class NoBidsMadeCondition(Condition):
def __init__(self):
super().__init__()
def eval(self, bidding):
... | none | 1 | 3.407275 | 3 | |
pyvibdmc/simulation_utilities/Constants.py | McCoyGroup/pyvibdmc | 6 | 6624198 | __all__ = ['Constants', 'get_atomic_num', 'get_atomic_string']
massDict = {'H': 1.00782503, 'D': 2.01410178, 'T': 3.01604928, 'He': 4.00260325, 'Li': 7.01600344, 'Be': 9.01218306,
'B': 11.00930536, 'C': 12.0, 'N': 14.003074, 'O': 15.99491462, 'F': 18.99840316, 'Ne': 19.99244018,
'Na': 22.989769... | __all__ = ['Constants', 'get_atomic_num', 'get_atomic_string']
massDict = {'H': 1.00782503, 'D': 2.01410178, 'T': 3.01604928, 'He': 4.00260325, 'Li': 7.01600344, 'Be': 9.01218306,
'B': 11.00930536, 'C': 12.0, 'N': 14.003074, 'O': 15.99491462, 'F': 18.99840316, 'Ne': 19.99244018,
'Na': 22.989769... | en | 0.518136 | :param atms: A list (or single string) of atomic element symbols :return: The atomic numbers of each of the atom strings you provide :param atomic_num: The atomic numbers of each of the atom strings you provide :return: A list of atomic element symbols Thanks, <NAME>, for this silly little class. Converter ... | 1.74423 | 2 |
api/redis_own.py | MetaExp/backend | 1 | 6624199 | <reponame>MetaExp/backend
import redis
import logging
import pickle
from util.datastructures import MetaPath
from typing import List, Tuple
from util.config import REDIS_HOST, REDIS_PORT, REDIS_PASSWORD
class Redis:
def __init__(self, data_set_name: str):
self._client = redis.StrictRedis(host=REDIS_HOST... | import redis
import logging
import pickle
from util.datastructures import MetaPath
from typing import List, Tuple
from util.config import REDIS_HOST, REDIS_PORT, REDIS_PASSWORD
class Redis:
def __init__(self, data_set_name: str):
self._client = redis.StrictRedis(host=REDIS_HOST, port=REDIS_PORT, passwor... | en | 0.297871 | # TODO: Match only keys without '_embedding' | 2.28334 | 2 |
mognet/cli/nodes.py | IBM/project-mognet | 0 | 6624200 | import asyncio
from datetime import datetime
from typing import List, Optional
import tabulate
import typer
from mognet.cli.cli_state import state
from mognet.cli.models import OutputFormat
from mognet.cli.run_in_loop import run_in_loop
from mognet.model.result import Result
from mognet.primitives.queries import Statu... | import asyncio
from datetime import datetime
from typing import List, Optional
import tabulate
import typer
from mognet.cli.cli_state import state
from mognet.cli.models import OutputFormat
from mognet.cli.run_in_loop import run_in_loop
from mognet.model.result import Result
from mognet.primitives.queries import Statu... | en | 0.956978 | Query each node for their status | 2.449694 | 2 |
python/Intro/sys/myImages.py | Joaxin/GitComments | 0 | 6624201 | <filename>python/Intro/sys/myImages.py
picFormats = ['jpg', 'png', 'gif', 'jpeg', 'bmp', 'webp']
print('Plz enter a file name:')
file = input()
if file.lower().split(".")[-1] not in picFormats:
print('Maybe not an image file. ')
else:
print(file + ' is an image file.') | <filename>python/Intro/sys/myImages.py
picFormats = ['jpg', 'png', 'gif', 'jpeg', 'bmp', 'webp']
print('Plz enter a file name:')
file = input()
if file.lower().split(".")[-1] not in picFormats:
print('Maybe not an image file. ')
else:
print(file + ' is an image file.') | none | 1 | 3.825533 | 4 | |
sdk/python/pulumi_aws/route53/zone.py | Charliekenney23/pulumi-aws | 0 | 6624202 | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import json
import warnings
import pulumi
import pulumi.runtime
from .. import utilities, tables
class Zone(pulumi.CustomResource):
... | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import json
import warnings
import pulumi
import pulumi.runtime
from .. import utilities, tables
class Zone(pulumi.CustomResource):
... | en | 0.830499 | # coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** A comment for the hosted zone. Defaults to 'Managed by Terraform'. The ID of the reusable delegation set whose NS records you want to as... | 1.741416 | 2 |
app/static/ToCompileSASS.py | smlopezza/SofiaLearning_public | 0 | 6624203 | 1# -*- coding: utf-8 -*-
"""
Created on Sun Dec 15 19:29:39 2019
@author: <NAME>
"""
import sass
import os
sass.compile(dirname=('sass', 'css'), output_style='compressed')
with open('css/styles.css') as styles_css:
print(styles_css.read())
| 1# -*- coding: utf-8 -*-
"""
Created on Sun Dec 15 19:29:39 2019
@author: <NAME>
"""
import sass
import os
sass.compile(dirname=('sass', 'css'), output_style='compressed')
with open('css/styles.css') as styles_css:
print(styles_css.read())
| en | 0.761806 | # -*- coding: utf-8 -*- Created on Sun Dec 15 19:29:39 2019 @author: <NAME> | 2.041638 | 2 |
stuff/tests/utils.py | fenimore/stuff | 1 | 6624204 | <reponame>fenimore/stuff
import os
def _data(filename: str) -> str:
file_path = os.path.join(
os.path.dirname(__file__), "data", filename
)
with open(file_path, "r") as file:
return file.read()
| import os
def _data(filename: str) -> str:
file_path = os.path.join(
os.path.dirname(__file__), "data", filename
)
with open(file_path, "r") as file:
return file.read() | none | 1 | 2.772364 | 3 | |
tests/test_append.py | wrwrwr/argparse-oappend | 0 | 6624205 | from oappend import OverrideAppendArgumentParser
class OAppendTests:
def test_default(self):
parser = OverrideAppendArgumentParser()
parser.add_argument('-n', action='oappend', default=['a', 'b'])
args = parser.parse_args([])
assert args.n == ['a', 'b']
def test_append(self):
... | from oappend import OverrideAppendArgumentParser
class OAppendTests:
def test_default(self):
parser = OverrideAppendArgumentParser()
parser.add_argument('-n', action='oappend', default=['a', 'b'])
args = parser.parse_args([])
assert args.n == ['a', 'b']
def test_append(self):
... | none | 1 | 3.160761 | 3 | |
binary trees/deleteNode_BT.py | mkoryor/Python | 0 | 6624206 |
# Python3 program to illustrate deletion in a Binary Tree
# class to create a node with data, left child and right child.
class Node:
def __init__(self,data):
self.data = data
self.left = None
self.right = None
# Inorder traversal of a binary tree
def inorder(temp):
if... |
# Python3 program to illustrate deletion in a Binary Tree
# class to create a node with data, left child and right child.
class Node:
def __init__(self,data):
self.data = data
self.left = None
self.right = None
# Inorder traversal of a binary tree
def inorder(temp):
if... | en | 0.790172 | # Python3 program to illustrate deletion in a Binary Tree # class to create a node with data, left child and right child. # Inorder traversal of a binary tree # function to delete the given deepest node (d_node) in binary tree # function to delete element in binary tree # Driver code # Inorder traversal before deletion... | 4.412398 | 4 |
src/priority/__init__.py | Kriechi/priority | 28 | 6624207 | # -*- coding: utf-8 -*-
"""
priority: HTTP/2 priority implementation for Python
"""
from .priority import ( # noqa
Stream,
PriorityTree,
DeadlockError,
PriorityLoop,
PriorityError,
DuplicateStreamError,
MissingStreamError,
TooManyStreamsError,
BadWeightError,
PseudoStreamError,
... | # -*- coding: utf-8 -*-
"""
priority: HTTP/2 priority implementation for Python
"""
from .priority import ( # noqa
Stream,
PriorityTree,
DeadlockError,
PriorityLoop,
PriorityError,
DuplicateStreamError,
MissingStreamError,
TooManyStreamsError,
BadWeightError,
PseudoStreamError,
... | en | 0.620992 | # -*- coding: utf-8 -*- priority: HTTP/2 priority implementation for Python # noqa | 1.196753 | 1 |
Problems/Array/customSorting.py | vishwajeet-hogale/LearnSTL | 0 | 6624208 | <reponame>vishwajeet-hogale/LearnSTL
class Solution(object):
def customSortString(self, order, str):
"""
:type order: str
:type str: str
:rtype: str
"""
d = {}
# 1. traverse T to build the counting
for c in str:
if c not in d:
d[c... | class Solution(object):
def customSortString(self, order, str):
"""
:type order: str
:type str: str
:rtype: str
"""
d = {}
# 1. traverse T to build the counting
for c in str:
if c not in d:
d[c] = 1
else:
... | en | 0.698698 | :type order: str :type str: str :rtype: str # 1. traverse T to build the counting # 2. traverse S to construct the relative order #reset the counting: #adding in unfined letters | 3.242779 | 3 |
02-sdp-intro/for_in.py | iproduct/intro-python | 3 | 6624209 | for i in range(1, 11, 2):
print(i)
fruits = ['Ябълка', 'Портокал', 'Круша', 'Череша']
for i in range(len(fruits)):
print(i + 1, fruits[i], sep=': ', end='\n', file=open('fruits.txt', 'a', encoding='utf-8'), flush=False)
for line in open('fruits.txt', 'r', encoding='utf-8'):
print(line) | for i in range(1, 11, 2):
print(i)
fruits = ['Ябълка', 'Портокал', 'Круша', 'Череша']
for i in range(len(fruits)):
print(i + 1, fruits[i], sep=': ', end='\n', file=open('fruits.txt', 'a', encoding='utf-8'), flush=False)
for line in open('fruits.txt', 'r', encoding='utf-8'):
print(line) | none | 1 | 3.342912 | 3 | |
nonbonded/backend/alembic/versions/f59d68c0a199_software_provenance.py | SimonBoothroyd/nonbonded | 5 | 6624210 | <reponame>SimonBoothroyd/nonbonded
"""Software provenance
Revision ID: f59d68c0a199
Revises: 66c8e3cf68ba
Create Date: 2021-01-27 11:54:28.746216
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "f59d68c0a199"
down_revision = "66c8e3cf68ba"
branch_labels = None
d... | """Software provenance
Revision ID: f59d68c0a199
Revises: 66c8e3cf68ba
Create Date: 2021-01-27 11:54:28.746216
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "f59d68c0a199"
down_revision = "66c8e3cf68ba"
branch_labels = None
depends_on = None
def upgrade():
... | en | 0.498235 | Software provenance Revision ID: f59d68c0a199 Revises: 66c8e3cf68ba Create Date: 2021-01-27 11:54:28.746216 # revision identifiers, used by Alembic. # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ### # ### commands auto generated by Alembic - please adjust! ### # ### end Alemb... | 1.711425 | 2 |
src/gtk/toga_gtk/widgets/internal/sourcetreemodel.py | luizoti/toga | 1,261 | 6624211 | <reponame>luizoti/toga<filename>src/gtk/toga_gtk/widgets/internal/sourcetreemodel.py
import copy
from toga_gtk.libs import GObject, Gtk
class SourceTreeModel(GObject.Object, Gtk.TreeModel):
"""
A full Gtk.TreeModel implementation backed by a toga.source.ListSource or
toga.source.TreeSource.
It stores... | import copy
from toga_gtk.libs import GObject, Gtk
class SourceTreeModel(GObject.Object, Gtk.TreeModel):
"""
A full Gtk.TreeModel implementation backed by a toga.source.ListSource or
toga.source.TreeSource.
It stores a reference to every node in the source.
TODO: If the source is a TreeSource, it... | en | 0.819153 | A full Gtk.TreeModel implementation backed by a toga.source.ListSource or toga.source.TreeSource. It stores a reference to every node in the source. TODO: If the source is a TreeSource, it uses the Node._parent attribute. Maybe an method could be added (like index()) to the TreeSource to access it. Args... | 2.393643 | 2 |
main.py | GANG5TER/calculator-1 | 4 | 6624212 | <filename>main.py
# Alveyworld-dev calculator
# Period 6
#
# Shrek is love. Shrek is life. Shrek is Alveyworld. All hail Shrek.
#
# Group 1: Team Jacob
# Members:
# * Jared
# * Josh
# * Max
# * Santiago
# * Travis
# Raw imports
import shlex
import math
import random
# Class imports
import team1
import ... | <filename>main.py
# Alveyworld-dev calculator
# Period 6
#
# Shrek is love. Shrek is life. Shrek is Alveyworld. All hail Shrek.
#
# Group 1: Team Jacob
# Members:
# * Jared
# * Josh
# * Max
# * Santiago
# * Travis
# Raw imports
import shlex
import math
import random
# Class imports
import team1
import ... | en | 0.86203 | # Alveyworld-dev calculator # Period 6 # # Shrek is love. Shrek is life. Shrek is Alveyworld. All hail Shrek. # # Group 1: Team Jacob # Members: # * Jared # * Josh # * Max # * Santiago # * Travis # Raw imports # Class imports # team five you're holding us back # ASCII escape colors # Used for the hello c... | 3.298567 | 3 |
dojo/unittests/test_aws_prowler_parser.py | Welly0902/django-DefectDojo | 3 | 6624213 | from django.test import TestCase
from dojo.tools.aws_prowler.parser import AWSProwlerParser
from django.utils import timezone
from dojo.models import Test, Engagement, Product, Product_Type, Test_Type
class TestAwsProwlerParser(TestCase):
def setup(self, testfile):
product_type = Product_Type(critical_pr... | from django.test import TestCase
from dojo.tools.aws_prowler.parser import AWSProwlerParser
from django.utils import timezone
from dojo.models import Test, Engagement, Product, Product_Type, Test_Type
class TestAwsProwlerParser(TestCase):
def setup(self, testfile):
product_type = Product_Type(critical_pr... | none | 1 | 2.494478 | 2 | |
RandomCoupling.py | nameforjoy/Synchronisation | 3 | 6624214 | """"
@author: JoyClimaco
"""
import numpy as np
import scipy.stats as ss
import networkx as nx
from NetworkFunctions import RandomCoupling
from NetworkFunctions import OrderParameter
from NetworkClasses import StuartLandau
A = np.load('A_BA_m2_N200_1.npy') # load adjacency matrix
w = np.load('w200_3unif.npy') # load f... | """"
@author: JoyClimaco
"""
import numpy as np
import scipy.stats as ss
import networkx as nx
from NetworkFunctions import RandomCoupling
from NetworkFunctions import OrderParameter
from NetworkClasses import StuartLandau
A = np.load('A_BA_m2_N200_1.npy') # load adjacency matrix
w = np.load('w200_3unif.npy') # load f... | en | 0.617141 | " @author: JoyClimaco # load adjacency matrix # load frequencies # network size # coupling constant # SL parameter # initial conditions # so the system doesn't fall into the attractor # Defines Stuart-Landau system # Random array for the coupling constants # Defines new SL system with this coupling weights # Time evolu... | 2.350261 | 2 |
project/settings_local.py | praekelt/mobius-skeleton | 3 | 6624215 | # This file is useful during development and must never be checked in.
import os
# NB: do not set DEBUG here. Some settings depend on it and setting it here has
# no effect. Edit an .env file and set it there. See
# https://django-environ.readthedocs.io/en/latest/ for details.
# Declare or redeclare variables here
... | # This file is useful during development and must never be checked in.
import os
# NB: do not set DEBUG here. Some settings depend on it and setting it here has
# no effect. Edit an .env file and set it there. See
# https://django-environ.readthedocs.io/en/latest/ for details.
# Declare or redeclare variables here
... | en | 0.544749 | # This file is useful during development and must never be checked in. # NB: do not set DEBUG here. Some settings depend on it and setting it here has # no effect. Edit an .env file and set it there. See # https://django-environ.readthedocs.io/en/latest/ for details. # Declare or redeclare variables here # Uncomment to... | 1.622585 | 2 |
tests/notes_db/note.py | axil/nvpy | 540 | 6624216 | import unittest
import itertools
import copy
from unittest.mock import patch
from nvpy.notes_db import Note, NoteStatus
from ._mixin import DBMixin
class NoteComparators(unittest.TestCase):
def test_need_save(self):
a = Note({'modifydate': 2, 'savedate': 1, 'syncdate': 0})
b = Note({'modifydate': ... | import unittest
import itertools
import copy
from unittest.mock import patch
from nvpy.notes_db import Note, NoteStatus
from ._mixin import DBMixin
class NoteComparators(unittest.TestCase):
def test_need_save(self):
a = Note({'modifydate': 2, 'savedate': 1, 'syncdate': 0})
b = Note({'modifydate': ... | en | 0.492349 | # If all fields excluding nvPY internal fields are same, those are same. # ignore # ignore # If content is not same, those are different. # ignore # ignore # changed # If other fields excluding nvPY internal fields are not same, those are different. # ignore # ignore # changed # Must accept non-hashable object like lis... | 2.552969 | 3 |
koch.py | GUELOU/PYTHON | 0 | 6624217 | from turtle import *
def koch(longueur, n):
if n == 0:
forward(longueur)
else:
koch(longueur/3, n-1)
left(60)
koch(longueur/3, n-1)
right(120)
koch(longueur/3, n-1)
left(60)
koch(longueur/3, n-1)
def flocon(taille, etape):
koch(taille, et... | from turtle import *
def koch(longueur, n):
if n == 0:
forward(longueur)
else:
koch(longueur/3, n-1)
left(60)
koch(longueur/3, n-1)
right(120)
koch(longueur/3, n-1)
left(60)
koch(longueur/3, n-1)
def flocon(taille, etape):
koch(taille, et... | none | 1 | 2.962715 | 3 | |
AlGDock/_external_paths.py | xinliu0609/AlGDock | 0 | 6624218 | import os, inspect
dir_external_paths = os.path.dirname(os.path.abspath(\
inspect.getfile(inspect.currentframe())))
def findPath(locations):
"""
Parses a list of locations, returning the first file that exists.
If none exist, then None is returned.
"""
import os.path
for location in locations:
if loc... | import os, inspect
dir_external_paths = os.path.dirname(os.path.abspath(\
inspect.getfile(inspect.currentframe())))
def findPath(locations):
"""
Parses a list of locations, returning the first file that exists.
If none exist, then None is returned.
"""
import os.path
for location in locations:
if loc... | en | 0.796457 | Parses a list of locations, returning the first file that exists. If none exist, then None is returned. # Download file and install program if available # Check that it has not already been downloaded # Define search paths for external programs and files # Defined for # David's IIT MacBook Pro, DSCR cluster, and CCB ... | 2.941873 | 3 |
pessoas/models.py | Maxceleste/alura-receitas-django | 0 | 6624219 | <gh_stars>0
from django.db import models
class Pessoa(models.Model):
nome = models.CharField(max_length = 200)
email = models.CharField(max_length = 200)
def __str__(self):
return self.nome | from django.db import models
class Pessoa(models.Model):
nome = models.CharField(max_length = 200)
email = models.CharField(max_length = 200)
def __str__(self):
return self.nome | none | 1 | 2.369756 | 2 | |
analyse.py | chanwoochoigit/IR_coursework_2 | 0 | 6624220 | <gh_stars>0
import itertools
import random
import re
import time
from collections import defaultdict
import json
from sklearn.metrics import classification_report
from sklearn.svm import SVC, LinearSVC
from sklearn.naive_bayes import GaussianNB
import numpy as np
from collections import Counter
from gensim.corpora.dict... | import itertools
import random
import re
import time
from collections import defaultdict
import json
from sklearn.metrics import classification_report
from sklearn.svm import SVC, LinearSVC
from sklearn.naive_bayes import GaussianNB
import numpy as np
from collections import Counter
from gensim.corpora.dictionary impor... | en | 0.567732 | #my preprocessing module from coursework 1 # using a rather unique structure to run faster # vocab[word] = word_index #convert word list to dictionary for speeding purposes # replace \n with a space, and if that creates a double space, replace it with a single space # trim # tokenise #arbitrarily limit word length for ... | 2.49675 | 2 |
linkograph/tests/testDynamic.py | mikiec84/linkshop | 6 | 6624221 | <filename>linkograph/tests/testDynamic.py
#!/usr/bin/env python3
"""Tests the enumeration.py package."""
import unittest
from linkograph import linkoCreate # For creating linkographs.
from linkograph import dynamic # The package under test.
class Test_addNode(unittest.TestCase):
"""Basic unit tests for addNod... | <filename>linkograph/tests/testDynamic.py
#!/usr/bin/env python3
"""Tests the enumeration.py package."""
import unittest
from linkograph import linkoCreate # For creating linkographs.
from linkograph import dynamic # The package under test.
class Test_addNode(unittest.TestCase):
"""Basic unit tests for addNod... | en | 0.583705 | #!/usr/bin/env python3 Tests the enumeration.py package. # For creating linkographs. # The package under test. Basic unit tests for addNode using size 4. Set up the parameters for the individual tests. "Performs the tests for each set of parameters. Tests the addNode function with a size of 4. | 2.676354 | 3 |
pirev/__init__.py | samjrdn/pirev-python | 0 | 6624222 | <filename>pirev/__init__.py
name = "pirev"
| <filename>pirev/__init__.py
name = "pirev"
| none | 1 | 1.089721 | 1 | |
Run_DNet.py | Matt-Golightly/MDS_Kara_One | 2 | 6624223 | <filename>Run_DNet.py
'''
This is used to repeatedly run DenseNet_One_vs_Rest2.py for the many variations of GAF, data sets, words, and subjects
'''
import os
subjects = ['MM05', 'MM08', 'MM09', 'MM10', 'MM11', 'MM12', 'MM14', 'MM15', 'MM16', 'MM18', 'MM19', 'MM20', 'MM21', 'P02']
for subject in subjects:
... | <filename>Run_DNet.py
'''
This is used to repeatedly run DenseNet_One_vs_Rest2.py for the many variations of GAF, data sets, words, and subjects
'''
import os
subjects = ['MM05', 'MM08', 'MM09', 'MM10', 'MM11', 'MM12', 'MM14', 'MM15', 'MM16', 'MM18', 'MM19', 'MM20', 'MM21', 'P02']
for subject in subjects:
... | en | 0.7866 | This is used to repeatedly run DenseNet_One_vs_Rest2.py for the many variations of GAF, data sets, words, and subjects #['GASF', 'GADF'] # type of image method, ['DTCWT', 'FILTERED', 'RAW', 'ICA'] #['gnaw', 'knew', 'pat', 'pot'] | 2.806286 | 3 |
chevah/compat/tests/normal/test_capabilities.py | chevah/compat | 5 | 6624224 | <reponame>chevah/compat
# -*- coding: utf-8 -*-
# Copyright (c) 2011 <NAME>.
# See LICENSE for details.
"""
Test for platform capabilities detection.
"""
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
try:
import win32security
except ImportError:
pas... | # -*- coding: utf-8 -*-
# Copyright (c) 2011 <NAME>.
# See LICENSE for details.
"""
Test for platform capabilities detection.
"""
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
try:
import win32security
except ImportError:
pass
from zope.interface.v... | en | 0.868782 | # -*- coding: utf-8 -*- # Copyright (c) 2011 <NAME>. # See LICENSE for details. Test for platform capabilities detection. Unit tests for process capabilities executed on Posix platforms. Check ProcessCapabilities initialization. When running under normal account, impersonation is always False on Unix. When runn... | 2.136129 | 2 |
1_SVG_converter_Gold.py | hirowgit/2B0_python_optmization_course | 0 | 6624225 | #!/usr/bin/env python
# coding: utf-8
# In[3]:
## Python basics for novice data scientists, supported by Wagatsuma Lab@Kyutech
#
# The MIT License (MIT): Copyright (c) 2021 <NAME> and Wagatsuma Lab<EMAIL>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associat... | #!/usr/bin/env python
# coding: utf-8
# In[3]:
## Python basics for novice data scientists, supported by Wagatsuma Lab@Kyutech
#
# The MIT License (MIT): Copyright (c) 2021 <NAME> and Wagatsuma Lab<EMAIL>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associat... | en | 0.707311 | #!/usr/bin/env python # coding: utf-8 # In[3]: ## Python basics for novice data scientists, supported by Wagatsuma Lab@Kyutech # # The MIT License (MIT): Copyright (c) 2021 <NAME> and Wagatsuma Lab<EMAIL> # # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated do... | 2.164641 | 2 |
ros/src/twist_controller/twist_controller.py | fwa785/CarND-Capstone-fwa785 | 0 | 6624226 | <filename>ros/src/twist_controller/twist_controller.py
from yaw_controller import YawController
from lowpass import LowPassFilter
from pid import PID
import rospy
GAS_DENSITY = 2.858
ONE_MPH = 0.44704
class Controller(object):
def __init__(self, vehicle_mass, fuel_capacity, brake_deadband, decel_limit,
... | <filename>ros/src/twist_controller/twist_controller.py
from yaw_controller import YawController
from lowpass import LowPassFilter
from pid import PID
import rospy
GAS_DENSITY = 2.858
ONE_MPH = 0.44704
class Controller(object):
def __init__(self, vehicle_mass, fuel_capacity, brake_deadband, decel_limit,
... | en | 0.77022 | # Create Yaw Controller # Setup the PID controller to control the throttle # setup Low pass filter to filter out the noise in the velocity message # If DBW is not enabled, reset the PID controller # filter velocity noise # Use PID controller to control the throttle # Return throttle, brake, steer | 2.705952 | 3 |
cubes/backends/mongo/store.py | she11c0de/cubes | 0 | 6624227 | # -*- coding=utf -*-
from ...stores import Store
import pymongo
__all__ = []
class MongoStore(Store):
def __init__(self, url, database=None, collection=None, **options):
self.client = pymongo.MongoClient(url, read_preference=pymongo.read_preferences.ReadPreference.SECONDARY)
self.database = databa... | # -*- coding=utf -*-
from ...stores import Store
import pymongo
__all__ = []
class MongoStore(Store):
def __init__(self, url, database=None, collection=None, **options):
self.client = pymongo.MongoClient(url, read_preference=pymongo.read_preferences.ReadPreference.SECONDARY)
self.database = databa... | en | 0.452249 | # -*- coding=utf -*- | 2.351949 | 2 |
python/caty/core/script/interpreter/__init__.py | hidaruma/caty | 0 | 6624228 | <gh_stars>0
from caty.core.script.interpreter.executor import *
| from caty.core.script.interpreter.executor import * | none | 1 | 1.005195 | 1 | |
1stSemester_PythonCourse/work3/E06_1827406005.py | chenyz2000/schoolCourses | 0 | 6624229 | <reponame>chenyz2000/schoolCourses
n=eval(input('please input positive odd number'))
mgc=[]
row,col=0,n//2
for i in range(n):
mgc.append([0]*n)
mgc[row][col]=1
for i in range(2,n**2+1):
r,l=(row-1+n)%n,(col+1)%n
if mgc[r][l]==0:
row , col=r,l
else:row =(row+1)%n
mgc[row][col]=i
import numpy ... | n=eval(input('please input positive odd number'))
mgc=[]
row,col=0,n//2
for i in range(n):
mgc.append([0]*n)
mgc[row][col]=1
for i in range(2,n**2+1):
r,l=(row-1+n)%n,(col+1)%n
if mgc[r][l]==0:
row , col=r,l
else:row =(row+1)%n
mgc[row][col]=i
import numpy as np
x=np.array(mgc)
print(x) | none | 1 | 3.327118 | 3 | |
Site_Visit_2.0/migrations/versions/b8f2a201eb31_.py | opacichjj/FEMA-PDA-and-Route-Optimizer | 0 | 6624230 | <gh_stars>0
"""empty message
Revision ID: <KEY>
Revises: <KEY>
Create Date: 2019-08-02 02:14:14.344836
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = '<KEY>'
branch_labels = None
depends_on = None
def upgrade():
# ### commands aut... | """empty message
Revision ID: <KEY>
Revises: <KEY>
Create Date: 2019-08-02 02:14:14.344836
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = '<KEY>'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated ... | en | 0.465347 | empty message Revision ID: <KEY> Revises: <KEY> Create Date: 2019-08-02 02:14:14.344836 # revision identifiers, used by Alembic. # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ### # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ### | 1.822521 | 2 |
imageGenie/trainingModule.py | ravi0531rp/imageGenie | 2 | 6624231 | <reponame>ravi0531rp/imageGenie<gh_stars>1-10
import numpy as np
import tensorflow as tf
import os
from glob import glob
from imageGenie.constants import Constants
from tensorflow.keras.models import Model, load_model
from tensorflow.keras.layers import Input, Dense, Conv2D, Flatten
from tensorflow.keras.optimizers ... | import numpy as np
import tensorflow as tf
import os
from glob import glob
from imageGenie.constants import Constants
from tensorflow.keras.models import Model, load_model
from tensorflow.keras.layers import Input, Dense, Conv2D, Flatten
from tensorflow.keras.optimizers import SGD, Adam
from tensorflow.keras.prepro... | none | 1 | 2.577975 | 3 | |
Python/python_basics/findRandom.py | paulolima18/ProgrammingMesh | 3 | 6624232 | <gh_stars>1-10
import random
def findRandom():
RandomNum = random.randint(0,55)
for k in range(3):
guess = eval(input("Number: "))
if RandomNum == guess:
print("Correct")
return;
elif randomNum > guess :
print("Bigger")
else:
... | import random
def findRandom():
RandomNum = random.randint(0,55)
for k in range(3):
guess = eval(input("Number: "))
if RandomNum == guess:
print("Correct")
return;
elif randomNum > guess :
print("Bigger")
else:
print(... | none | 1 | 3.761706 | 4 | |
tools/validateAttr.py | fsanges/glTools | 165 | 6624233 | <gh_stars>100-1000
import maya.cmds as mc
import maya.OpenMaya as OpenMaya
import glTools.utils.base
import glTools.utils.mesh
import math
def validatePoints(obj):
'''
'''
# Initiate check
check = 0
# Get points
pArray = glTools.utils.base.getMPointArray(obj,worldSpace=False)
# Check points
for i in rang... | import maya.cmds as mc
import maya.OpenMaya as OpenMaya
import glTools.utils.base
import glTools.utils.mesh
import math
def validatePoints(obj):
'''
'''
# Initiate check
check = 0
# Get points
pArray = glTools.utils.base.getMPointArray(obj,worldSpace=False)
# Check points
for i in range(pArray.length()):... | en | 0.214993 | # Initiate check # Get points # Check points # Check point values # Check NaN # Check INF # Return result # Initiate check # Get points # Check points # Check point values # Check NaN # Check INF # Return result # Initiate check # Get meshFn # Get UV Sets # Get UV values # Check empty UV set # Check U values # Check V ... | 2.241363 | 2 |
corpus_statistics.py | GreenParachute/wordnet-randomwalk-python | 9 | 6624234 | <filename>corpus_statistics.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Calculate statistics on already generated random walk cporpora.
Assumes input is a text file where 1 line = 1 sentence.
Copyright © 2019 <NAME>, <NAME>. Technological University Dublin, ADAPT Centre.
All Rights Reserved.
Redistributi... | <filename>corpus_statistics.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Calculate statistics on already generated random walk cporpora.
Assumes input is a text file where 1 line = 1 sentence.
Copyright © 2019 <NAME>, <NAME>. Technological University Dublin, ADAPT Centre.
All Rights Reserved.
Redistributi... | en | 0.763738 | #!/usr/bin/env python # -*- coding: utf-8 -*- Calculate statistics on already generated random walk cporpora. Assumes input is a text file where 1 line = 1 sentence. Copyright © 2019 <NAME>, <NAME>. Technological University Dublin, ADAPT Centre. All Rights Reserved. Redistribution and use in source and binary forms... | 2.855374 | 3 |
bench/a.py | t1mch0w/memc3 | 0 | 6624235 | <gh_stars>0
import sys
filea=open(sys.argv[1],'r')
fileb=open(sys.argv[2],'r')
load_key=set()
run_key=set()
for l in filea:
if 'usertable' in l:
load_key.add(l.split()[2])
for l in fileb:
if 'usertable' in l:
run_key.add(l.split()[2])
num_match=0
num_nomatch=0
for k in run_key:
if k in load_key:
num_match... | import sys
filea=open(sys.argv[1],'r')
fileb=open(sys.argv[2],'r')
load_key=set()
run_key=set()
for l in filea:
if 'usertable' in l:
load_key.add(l.split()[2])
for l in fileb:
if 'usertable' in l:
run_key.add(l.split()[2])
num_match=0
num_nomatch=0
for k in run_key:
if k in load_key:
num_match+=1
else:
... | none | 1 | 2.650492 | 3 | |
src/forum/schema.py | VishalZ123/gymkhana_portal | 16 | 6624236 | import graphene
from graphene import relay
from graphene_django import DjangoObjectType
from graphene_django.forms.mutation import DjangoModelFormMutation
from graphql_jwt.decorators import login_required
from forum.forms import TopicForm, AnswerForm
from forum.models import Topic, Answer
class AnswerNode(DjangoObje... | import graphene
from graphene import relay
from graphene_django import DjangoObjectType
from graphene_django.forms.mutation import DjangoModelFormMutation
from graphql_jwt.decorators import login_required
from forum.forms import TopicForm, AnswerForm
from forum.models import Topic, Answer
class AnswerNode(DjangoObje... | none | 1 | 2.129931 | 2 | |
preparing_data/prepare_test_dataset.py | Kukuster/SelfDecode-phasing | 0 | 6624237 | import numpy as np
from lib.pd import pd_read_vcf
"""
Have to rewrite this using bcftools (and tabix for indexing input datasets)
So the function receives two inputs: full dataset of test samples, and list of sites.
Currently this works under the assumption:
- both FULL and CHIP datasets are harmonized in the same ... | import numpy as np
from lib.pd import pd_read_vcf
"""
Have to rewrite this using bcftools (and tabix for indexing input datasets)
So the function receives two inputs: full dataset of test samples, and list of sites.
Currently this works under the assumption:
- both FULL and CHIP datasets are harmonized in the same ... | en | 0.906182 | Have to rewrite this using bcftools (and tabix for indexing input datasets) So the function receives two inputs: full dataset of test samples, and list of sites. Currently this works under the assumption: - both FULL and CHIP datasets are harmonized in the same way Prepares test dataset from: 1) A full dataset of tes... | 2.954931 | 3 |
notebooks/char_rnn.py | lewfish/gmm-pytorch | 1 | 6624238 | <filename>notebooks/char_rnn.py<gh_stars>1-10
# Generates names from different languages using an RNN.
# Reading material:
# https://karpathy.github.io/2015/05/21/rnn-effectiveness/
# https://pytorch.org/tutorials/intermediate/char_rnn_generation_tutorial.html
# The data loading part of this code was copied and adapt... | <filename>notebooks/char_rnn.py<gh_stars>1-10
# Generates names from different languages using an RNN.
# Reading material:
# https://karpathy.github.io/2015/05/21/rnn-effectiveness/
# https://pytorch.org/tutorials/intermediate/char_rnn_generation_tutorial.html
# The data loading part of this code was copied and adapt... | en | 0.673496 | # Generates names from different languages using an RNN. # Reading material: # https://karpathy.github.io/2015/05/21/rnn-effectiveness/ # https://pytorch.org/tutorials/intermediate/char_rnn_generation_tutorial.html # The data loading part of this code was copied and adapted from # https://pytorch.org/tutorials/intermed... | 3.017147 | 3 |
tests/test_auto_mixed_precision_model_path.py | Microsoft/onnxconverter-common | 0 | 6624239 | <reponame>Microsoft/onnxconverter-common
import unittest
import numpy as np
import onnxruntime as _ort
import onnx
import os
from distutils.version import LooseVersion as V
from onnxconverter_common.onnx_fx import Graph
from onnxconverter_common.onnx_ex import get_maximum_opset_supported
from onnxconverter_common.auto_... | import unittest
import numpy as np
import onnxruntime as _ort
import onnx
import os
from distutils.version import LooseVersion as V
from onnxconverter_common.onnx_fx import Graph
from onnxconverter_common.onnx_ex import get_maximum_opset_supported
from onnxconverter_common.auto_mixed_precision_model_path import auto_co... | de | 0.37605 | # suite.debug() | 2.157542 | 2 |
kosakana_fan_blog_get_text.py | yukou-isshiki/hinatazaka_blog | 0 | 6624240 | <reponame>yukou-isshiki/hinatazaka_blog
from urllib import request,parse
from urllib import error
from bs4 import BeautifulSoup
f = open("kosakana_fan_blog_url.txt", "r")
wf = open("kosakana_fan_blog_text.txt", "w")
lines = f.readlines()
for line in lines:
print(line)
try:
blog_html = request.urlope... | from urllib import request,parse
from urllib import error
from bs4 import BeautifulSoup
f = open("kosakana_fan_blog_url.txt", "r")
wf = open("kosakana_fan_blog_text.txt", "w")
lines = f.readlines()
for line in lines:
print(line)
try:
blog_html = request.urlopen(line)
blog_soup = BeautifulSou... | none | 1 | 3.032402 | 3 | |
venv_mac/lib/python3.7/site-packages/flask_pagedown/fields.py | mazx4960/Notes-WebApp | 232 | 6624241 | <gh_stars>100-1000
from wtforms.fields import TextAreaField
from .widgets import PageDown
class PageDownField(TextAreaField):
widget = PageDown()
| from wtforms.fields import TextAreaField
from .widgets import PageDown
class PageDownField(TextAreaField):
widget = PageDown() | none | 1 | 1.875602 | 2 | |
Discord-Moderation-Bot-master/events/member.py | MonsterGaming9845/Alphy | 0 | 6624242 | import inspect
import sys
import time
import discord
from helpers.embed_builder import EmbedBuilder
from events.base import EventHandler
class MemberJoinEvent(EventHandler):
def __init__(self, client_instance):
self.client = client_instance
self.storage = self.client.storage
self.event =... | import inspect
import sys
import time
import discord
from helpers.embed_builder import EmbedBuilder
from events.base import EventHandler
class MemberJoinEvent(EventHandler):
def __init__(self, client_instance):
self.client = client_instance
self.storage = self.client.storage
self.event =... | en | 0.950934 | # Get member from args # Loop over the muted users # if the user_id for this user_info matches the member who joined the guild # Mute is expired. Remove it from the guild's storage # Build a mute expire embed and message it to the log channel # Mute is not expired. Re-add it to the offender # Get the guild from the arg... | 2.396878 | 2 |
basic_programs/IsQuadConvex.py | manuaatitya/computer_graphics | 0 | 6624243 | class Point:
def __init__(self,x,y):
self.x = x
self.y = y
class Quad:
def __init__(self):
self.quad = []
self.isConvex = 0
def dot(self, vector1, vector2):
return vector1.x * vector1.x + vector1.y * vector2.y
def cross(self, vector1, vector2):
... | class Point:
def __init__(self,x,y):
self.x = x
self.y = y
class Quad:
def __init__(self):
self.quad = []
self.isConvex = 0
def dot(self, vector1, vector2):
return vector1.x * vector1.x + vector1.y * vector2.y
def cross(self, vector1, vector2):
... | en | 0.803837 | # BD vector # BA vector # BC vector # AC vector # AD vector # AB vector | 3.757424 | 4 |
tpch/tf_tpu.py | pdet/tpc-tpu | 3 | 6624244 | import numpy as np
import pandas as pd
import os
import tensorflow as tf
from tensorflow.contrib import tpu
from tensorflow.contrib.cluster_resolver import TPUClusterResolver
import sys
from subprocess import Popen
import time
l_shipdate = 0
l_discount = 0
l_quantity = 0
l_extendedprice = 0
l_tax = 0
l_returnflag = 0... | import numpy as np
import pandas as pd
import os
import tensorflow as tf
from tensorflow.contrib import tpu
from tensorflow.contrib.cluster_resolver import TPUClusterResolver
import sys
from subprocess import Popen
import time
l_shipdate = 0
l_discount = 0
l_quantity = 0
l_extendedprice = 0
l_tax = 0
l_returnflag = 0... | en | 0.3432 | # Turn dates into integers # Query 01 and 06 # Query 01 # Dictionaries # Popen('capture_tpu_profile --tpu=$TPU_NAME --logdir=${STORAGE_BUCKET}/res --duration_ms=60000 --num_tracing_attempts=10', shell=True,stdin=None, stdout=None, stderr=None, close_fds=True) # time.sleep(5) # q6() | 2.208227 | 2 |
limix_ext/rglmm/test/test_rglmm.py | glimix/limix-ext | 0 | 6624245 | import limix_ext as lext
from numpy.testing import assert_
import numpy as np
import os
from os.path import join
def test_rglmm_binomial():
folder = os.path.dirname(os.path.realpath(__file__))
nsuc = np.load(join(folder, "nsuc.npy"))
ntri = np.load(join(folder, "ntri.npy"))
K = np.load(join(folder, "... | import limix_ext as lext
from numpy.testing import assert_
import numpy as np
import os
from os.path import join
def test_rglmm_binomial():
folder = os.path.dirname(os.path.realpath(__file__))
nsuc = np.load(join(folder, "nsuc.npy"))
ntri = np.load(join(folder, "ntri.npy"))
K = np.load(join(folder, "... | none | 1 | 2.040982 | 2 | |
twml/__init__.py | thingswise/tw-ml-sdk-python | 1 | 6624246 | <reponame>thingswise/tw-ml-sdk-python
# Copyright 2016 Thingswise, LLC
#
# 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 b... | # Copyright 2016 Thingswise, LLC
#
# 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 writi... | en | 0.84096 | # Copyright 2016 Thingswise, LLC # # 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 writi... | 1.376373 | 1 |
uukanshu/book_tracker.py | stonewell/booktracker | 0 | 6624247 | import datetime
from pathlib import Path
from uukanshu.index_parser import IndexParser
from uukanshu.page_tracker import PageTracker
from book_tracker_base import TrackerBase
class Tracker(TrackerBase):
def __init__(self, url, author, title, data_dir, timeout):
super().__init__(url, author, title, data_d... | import datetime
from pathlib import Path
from uukanshu.index_parser import IndexParser
from uukanshu.page_tracker import PageTracker
from book_tracker_base import TrackerBase
class Tracker(TrackerBase):
def __init__(self, url, author, title, data_dir, timeout):
super().__init__(url, author, title, data_d... | none | 1 | 2.803799 | 3 | |
netdash/hostlookup_bluecat/api/serializers.py | NetDash/netdash | 15 | 6624248 | from rest_framework import serializers
class BlueCatHostLookupResponseSerializer(serializers.Serializer):
mac = serializers.CharField(required=False)
ipv4 = serializers.IPAddressField(required=False)
ipv6 = serializers.IPAddressField(required=False)
hostnames = serializers.ListField(child=serializers.... | from rest_framework import serializers
class BlueCatHostLookupResponseSerializer(serializers.Serializer):
mac = serializers.CharField(required=False)
ipv4 = serializers.IPAddressField(required=False)
ipv6 = serializers.IPAddressField(required=False)
hostnames = serializers.ListField(child=serializers.... | none | 1 | 2.008823 | 2 | |
src/input/adaptive.py | ngannguyen/aimseqtk | 2 | 6624249 | <filename>src/input/adaptive.py<gh_stars>1-10
#Copyright (C) 2013 by <NAME>
#
#Released under the MIT license, see LICENSE.txt
'''
Parse Adaptive Biotechnologies (http://www.adaptivebiotech.com/) data files
Edit: Mon Jun 30 12:12:37 PDT 2014
Update to the current format of Adaptive TSV files (as of June 30 2014)
'''
... | <filename>src/input/adaptive.py<gh_stars>1-10
#Copyright (C) 2013 by <NAME>
#
#Released under the MIT license, see LICENSE.txt
'''
Parse Adaptive Biotechnologies (http://www.adaptivebiotech.com/) data files
Edit: Mon Jun 30 12:12:37 PDT 2014
Update to the current format of Adaptive TSV files (as of June 30 2014)
'''
... | en | 0.505914 | #Copyright (C) 2013 by <NAME> # #Released under the MIT license, see LICENSE.txt Parse Adaptive Biotechnologies (http://www.adaptivebiotech.com/) data files Edit: Mon Jun 30 12:12:37 PDT 2014 Update to the current format of Adaptive TSV files (as of June 30 2014) #nucleotide aminoAcid count frequencyCount ... | 2.006893 | 2 |
benchmark/workload/tpch.py | ChenYi015/Raven | 1 | 6624250 | # Copyright 2021 Raven 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 applicable law or ... | # Copyright 2021 Raven 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 applicable law or ... | en | 0.857412 | # Copyright 2021 Raven 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 applicable law or ... | 1.977948 | 2 |