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
adventure-cards/package/main.py
DaneRosa/adventure-cards
0
2100
import json def hydrateCards(rawDeckDataPath): pack = [] rawDeckData = json.load(open(rawDeckDataPath,)) for index, item in enumerate(rawDeckData): deck = [] # print(index,item) for i in rawDeckData[item]: card ={ f'{index}': { ...
import json def hydrateCards(rawDeckDataPath): pack = [] rawDeckData = json.load(open(rawDeckDataPath,)) for index, item in enumerate(rawDeckData): deck = [] # print(index,item) for i in rawDeckData[item]: card ={ f'{index}': { ...
ru
0.121789
# print(index,item)
2.987642
3
demo/cnn_predict.py
huynhtnhut97/keras-video-classifier
108
2101
import numpy as np from keras import backend as K import os import sys K.set_image_dim_ordering('tf') def patch_path(path): return os.path.join(os.path.dirname(__file__), path) def main(): sys.path.append(patch_path('..')) data_dir_path = patch_path('very_large_data') model_dir_path = patch_path('...
import numpy as np from keras import backend as K import os import sys K.set_image_dim_ordering('tf') def patch_path(path): return os.path.join(os.path.dirname(__file__), path) def main(): sys.path.append(patch_path('..')) data_dir_path = patch_path('very_large_data') model_dir_path = patch_path('...
none
1
2.483344
2
pyconde/context_processors.py
EuroPython/djep
5
2102
from django.conf import settings def less_settings(request): return { 'use_dynamic_less_in_debug': getattr(settings, 'LESS_USE_DYNAMIC_IN_DEBUG', True) }
from django.conf import settings def less_settings(request): return { 'use_dynamic_less_in_debug': getattr(settings, 'LESS_USE_DYNAMIC_IN_DEBUG', True) }
none
1
1.735506
2
pmdarima/preprocessing/endog/boxcox.py
tuomijal/pmdarima
736
2103
<reponame>tuomijal/pmdarima<gh_stars>100-1000 # -*- coding: utf-8 -*- from scipy import stats import numpy as np import warnings from ...compat import check_is_fitted, pmdarima as pm_compat from .base import BaseEndogTransformer __all__ = ['BoxCoxEndogTransformer'] class BoxCoxEndogTransformer(BaseEndogTransforme...
# -*- coding: utf-8 -*- from scipy import stats import numpy as np import warnings from ...compat import check_is_fitted, pmdarima as pm_compat from .base import BaseEndogTransformer __all__ = ['BoxCoxEndogTransformer'] class BoxCoxEndogTransformer(BaseEndogTransformer): r"""Apply the Box-Cox transformation t...
en
0.652211
# -*- coding: utf-8 -*- Apply the Box-Cox transformation to an endogenous array The Box-Cox transformation is applied to non-normal data to coerce it more towards a normal distribution. It's specified as:: (((y + lam2) ** lam1) - 1) / lam1, if lmbda != 0, else log(y + lam2) Parameters ...
2.847478
3
backend/src/baserow/api/user/registries.py
ashishdhngr/baserow
1
2104
<gh_stars>1-10 from baserow.core.registry import Instance, Registry class UserDataType(Instance): """ The user data type can be used to inject an additional payload to the API JWT response. This is the response when a user authenticates or refreshes his token. The returned dict of the `get_user_data` ...
from baserow.core.registry import Instance, Registry class UserDataType(Instance): """ The user data type can be used to inject an additional payload to the API JWT response. This is the response when a user authenticates or refreshes his token. The returned dict of the `get_user_data` method is added...
en
0.835588
The user data type can be used to inject an additional payload to the API JWT response. This is the response when a user authenticates or refreshes his token. The returned dict of the `get_user_data` method is added to the payload under the key containing the type name. Example: class TestUserData...
3.341174
3
Week 2/code.py
aklsh/EE2703
0
2105
''' ------------------------------------- Assignment 2 - EE2703 (Jan-May 2020) Done by <NAME> (EE18B122) Created on 18/01/20 Last Modified on 04/02/20 ------------------------------------- ''' # importing necessary libraries import sys import cmath import numpy as np import pandas as pd # To improve readability C...
''' ------------------------------------- Assignment 2 - EE2703 (Jan-May 2020) Done by <NAME> (EE18B122) Created on 18/01/20 Last Modified on 04/02/20 ------------------------------------- ''' # importing necessary libraries import sys import cmath import numpy as np import pandas as pd # To improve readability C...
en
0.788877
------------------------------------- Assignment 2 - EE2703 (Jan-May 2020) Done by <NAME> (EE18B122) Created on 18/01/20 Last Modified on 04/02/20 ------------------------------------- # importing necessary libraries # To improve readability # Classes for each circuit component # Convert a number in engineer's form...
3.219168
3
Lib/Co.py
M507/Guessing-passwords-using-machine-learning
6
2106
<gh_stars>1-10 import subprocess import os.path """ Stylish input() """ def s_input(string): return input(string+">").strip("\n") """ Execute command locally """ def execute_command(command): if len(command) > 0: print(command) proc = subprocess.Popen(command.split(" "), stdout=subprocess.PI...
import subprocess import os.path """ Stylish input() """ def s_input(string): return input(string+">").strip("\n") """ Execute command locally """ def execute_command(command): if len(command) > 0: print(command) proc = subprocess.Popen(command.split(" "), stdout=subprocess.PIPE, cwd="/tmp")...
en
0.699668
Stylish input() Execute command locally Get all subdirectories of a directory. # subdirectories = [dirname + "/" + subDirName for subDirName in subdirectories] Rocket science
3.394792
3
project3_code/part_0/main.py
rachelbrown347/CS294-26_code
1
2107
<gh_stars>1-10 import numpy as np import matplotlib.pyplot as plt from skimage.exposure import rescale_intensity from unsharp import * # Load file and normalize to 0-1 fname = 'iguana.jpg' im = plt.imread(fname) if im.mean() >= 1: im = im/255. sigma = 5 amplitude = 1.5 imsharp = unsharp_mask(im, sigma, amplitud...
import numpy as np import matplotlib.pyplot as plt from skimage.exposure import rescale_intensity from unsharp import * # Load file and normalize to 0-1 fname = 'iguana.jpg' im = plt.imread(fname) if im.mean() >= 1: im = im/255. sigma = 5 amplitude = 1.5 imsharp = unsharp_mask(im, sigma, amplitude) imsharp = re...
en
0.917584
# Load file and normalize to 0-1
2.479292
2
meregistro/apps/registro/models/EstablecimientoDomicilio.py
MERegistro/meregistro
0
2108
<reponame>MERegistro/meregistro # -*- coding: utf-8 -*- from django.db import models from apps.registro.models.TipoDomicilio import TipoDomicilio from apps.registro.models.Localidad import Localidad from apps.registro.models.Establecimiento import Establecimiento from django.core.exceptions import ValidationError from ...
# -*- coding: utf-8 -*- from django.db import models from apps.registro.models.TipoDomicilio import TipoDomicilio from apps.registro.models.Localidad import Localidad from apps.registro.models.Establecimiento import Establecimiento from django.core.exceptions import ValidationError from apps.seguridad.audit import audi...
en
0.769321
# -*- coding: utf-8 -*-
1.854381
2
python_for_everybody/py2_p4i_old/6.5findslicestringextract.py
timothyyu/p4e-prac
0
2109
<gh_stars>0 # 6.5 Write code using find() and string slicing (see section 6.10) to extract # the number at the end of the line below. # Convert the extracted value to a floating point number and print it out. text = "X-DSPAM-Confidence: 0.8475"; pos = text.find(':') text = float(text[pos+1:]) print text
# 6.5 Write code using find() and string slicing (see section 6.10) to extract # the number at the end of the line below. # Convert the extracted value to a floating point number and print it out. text = "X-DSPAM-Confidence: 0.8475"; pos = text.find(':') text = float(text[pos+1:]) print text
en
0.826911
# 6.5 Write code using find() and string slicing (see section 6.10) to extract # the number at the end of the line below. # Convert the extracted value to a floating point number and print it out.
3.940233
4
tools/lucid/engine.py
Petr-By/qtpyvis
3
2110
import logging logger = logging.getLogger(__name__) print(f"!!!!!!!!!! getEffectiveLevel: {logger.getEffectiveLevel()} !!!!!!!!!!!!!") from dltb.base.observer import Observable, change from network import Network, loader from network.lucid import Network as LucidNetwork # lucid.modelzoo.vision_models: # A module ...
import logging logger = logging.getLogger(__name__) print(f"!!!!!!!!!! getEffectiveLevel: {logger.getEffectiveLevel()} !!!!!!!!!!!!!") from dltb.base.observer import Observable, change from network import Network, loader from network.lucid import Network as LucidNetwork # lucid.modelzoo.vision_models: # A module ...
en
0.819269
# lucid.modelzoo.vision_models: # A module providinge the pretrained networks by name, e.g. # models.AlexNet The Engine is a wrapper around the lucid module. Attributes ---------- _network: LucidNetwork The currently selected lucid network. None if no model is selected. _model:...
2.322529
2
synapse/storage/events.py
natamelo/synapse
0
2111
# -*- coding: utf-8 -*- # Copyright 2014-2016 OpenMarket Ltd # Copyright 2018-2019 New Vector Ltd # Copyright 2019 The Matrix.org Foundation C.I.C. # # 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 Licens...
# -*- coding: utf-8 -*- # Copyright 2014-2016 OpenMarket Ltd # Copyright 2018-2019 New Vector Ltd # Copyright 2019 The Matrix.org Foundation C.I.C. # # 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 Licens...
en
0.907159
# -*- coding: utf-8 -*- # Copyright 2014-2016 OpenMarket Ltd # Copyright 2018-2019 New Vector Ltd # Copyright 2019 The Matrix.org Foundation C.I.C. # # 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 Licens...
1.240282
1
dev/buildtool/metrics.py
premm1983/Spinnaker
0
2112
<reponame>premm1983/Spinnaker<gh_stars>0 # Copyright 2017 Google Inc. 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 #...
# Copyright 2017 Google Inc. 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 a...
en
0.827511
# Copyright 2017 Google Inc. 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 a...
2.108068
2
src/python/pants/backend/android/tasks/aapt_builder.py
hythloday/pants
11
2113
<gh_stars>10-100 # coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (nested_scopes, generators, division, absolute_import, with_statement, print_function, unicode_literals) imp...
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (nested_scopes, generators, division, absolute_import, with_statement, print_function, unicode_literals) import os import sub...
en
0.758121
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). Build an android bundle with compiled code and assets. This class gathers compiled classes (an Android dex archive) and packages it with the target's resource files. The...
2.033258
2
fat/fat_bert_nq/ppr/apr_lib.py
kiss2u/google-research
1
2114
# coding=utf-8 # Copyright 2020 The Google Research Authors. # # 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 applicab...
# coding=utf-8 # Copyright 2020 The Google Research Authors. # # 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 applicab...
en
0.853135
# coding=utf-8 # Copyright 2020 The Google Research Authors. # # 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 applicab...
2.064864
2
src/optimal_gardening.py
evanlynch/optimal-gardening
0
2115
<gh_stars>0 import os import sys import time from IPython.display import Image import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sb sb.set_style("dark") #### Initial Setup #### #plant info plant_info = pd.read_csv('../data/plant_data.csv') plant_info.index.name = 'plant_index' ...
import os import sys import time from IPython.display import Image import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sb sb.set_style("dark") #### Initial Setup #### #plant info plant_info = pd.read_csv('../data/plant_data.csv') plant_info.index.name = 'plant_index' plants = pla...
en
0.900279
#### Initial Setup #### #plant info #calculate weighted average preference for each plant #bed info #time dimension #for keeping track of what axis is which ##### Constraints ##### #initialize sun constraint. 1 where plant can feasibly be planted in bed. 0 where sun requirements do not match. Force plan to be 0 where s...
2.906692
3
adv_lib/utils/attack_utils.py
Daulbaev/adversarial-library
55
2116
import warnings from collections import OrderedDict from distutils.version import LooseVersion from functools import partial from inspect import isclass from typing import Callable, Optional, Dict, Union import numpy as np import torch import tqdm from torch import Tensor, nn from torch.nn import functional as F from...
import warnings from collections import OrderedDict from distutils.version import LooseVersion from functools import partial from inspect import isclass from typing import Callable, Optional, Dict, Union import numpy as np import torch import tqdm from torch import Tensor, nn from torch.nn import functional as F from...
en
0.776046
Generates one random target in (num_classes - 1) possibilities for each label that is different from the original label. Parameters ---------- labels: Tensor Original labels. Generated targets will be different from labels. num_classes: int Number of classes to generate the random t...
2.192145
2
thawSlumpChangeDet/polygons_compare.py
Summer0328/ChangeDet_DL-1
3
2117
#!/usr/bin/env python # Filename: polygons_cd """ introduction: compare two polygons in to shape file authors: <NAME> email:<EMAIL> add time: 26 February, 2020 """ import sys,os from optparse import OptionParser # added path of DeeplabforRS sys.path.insert(0, os.path.expanduser('~/codes/PycharmProjects/DeeplabforRS...
#!/usr/bin/env python # Filename: polygons_cd """ introduction: compare two polygons in to shape file authors: <NAME> email:<EMAIL> add time: 26 February, 2020 """ import sys,os from optparse import OptionParser # added path of DeeplabforRS sys.path.insert(0, os.path.expanduser('~/codes/PycharmProjects/DeeplabforRS...
en
0.482635
#!/usr/bin/env python # Filename: polygons_cd introduction: compare two polygons in to shape file authors: <NAME> email:<EMAIL> add time: 26 February, 2020 # added path of DeeplabforRS # check files do exist # check projection of the shape file, should be the same # conduct change detection # get expanding and shrinki...
2.845616
3
andela_labs/Car Class Lab (OOP)/car.py
brotich/andela_bootcamp_X
0
2118
<reponame>brotich/andela_bootcamp_X class Car(object): """ Car class that can be used to instantiate various vehicles. It takes in arguments that depict the type, model, and name of the vehicle """ def __init__(self, name="General", model="GM", car_type="saloon"): num_of_wh...
class Car(object): """ Car class that can be used to instantiate various vehicles. It takes in arguments that depict the type, model, and name of the vehicle """ def __init__(self, name="General", model="GM", car_type="saloon"): num_of_wheels = 4 num_of_doors = 4 ...
en
0.917191
Car class that can be used to instantiate various vehicles. It takes in arguments that depict the type, model, and name of the vehicle
3.995858
4
CV Model/Model - JupyterNotebook/mrcnn/tfliteconverter.py
fcsiba/Smart-Cart
0
2119
<filename>CV Model/Model - JupyterNotebook/mrcnn/tfliteconverter.py import tensorflow as tf # Convert the model. converter = tf.lite.TFLiteConverter.from_saved_model('model.py') tflite_model = converter.convert() open("trash_ai.tflite", "wb").write(tflite_model)
<filename>CV Model/Model - JupyterNotebook/mrcnn/tfliteconverter.py import tensorflow as tf # Convert the model. converter = tf.lite.TFLiteConverter.from_saved_model('model.py') tflite_model = converter.convert() open("trash_ai.tflite", "wb").write(tflite_model)
en
0.396529
# Convert the model.
2.460873
2
basicapp/cron.py
shivamsinghal212/Url-Shortener
0
2120
from django_cron import CronJobBase, Schedule from .models import Link from django.utils import timezone class MyCronJob(CronJobBase): RUN_EVERY_MINS = 1 # every 2 hours schedule = Schedule(run_every_mins=RUN_EVERY_MINS) code = 'basicapp.cron' # a unique code def do(self): current_time = t...
from django_cron import CronJobBase, Schedule from .models import Link from django.utils import timezone class MyCronJob(CronJobBase): RUN_EVERY_MINS = 1 # every 2 hours schedule = Schedule(run_every_mins=RUN_EVERY_MINS) code = 'basicapp.cron' # a unique code def do(self): current_time = t...
en
0.736629
# every 2 hours # a unique code
2.842952
3
weasyprint/tests/test_stacking.py
Smylers/WeasyPrint
0
2121
# coding: utf8 """ weasyprint.tests.stacking ------------------------- :copyright: Copyright 2011-2012 <NAME> and contributors, see AUTHORS. :license: BSD, see LICENSE for details. """ from __future__ import division, unicode_literals from ..stacking import StackingContext from .test_boxes import se...
# coding: utf8 """ weasyprint.tests.stacking ------------------------- :copyright: Copyright 2011-2012 <NAME> and contributors, see AUTHORS. :license: BSD, see LICENSE for details. """ from __future__ import division, unicode_literals from ..stacking import StackingContext from .test_boxes import se...
en
0.471356
# coding: utf8 weasyprint.tests.stacking ------------------------- :copyright: Copyright 2011-2012 <NAME> and contributors, see AUTHORS. :license: BSD, see LICENSE for details. \ <p id=lorem></p> <div style="position: relative"> <p id=lipsum></p> </p> \ <div styl...
2.241174
2
django-magic-link/customers/views.py
industrydive/sourcelist
5
2122
from django.shortcuts import render from django.contrib.auth.models import User from django.contrib.auth.decorators import login_required from sesame import utils from django.core.mail import send_mail def login_page(request): if request.method == "POST": email = request.POST.get("emailId") user =...
from django.shortcuts import render from django.contrib.auth.models import User from django.contrib.auth.decorators import login_required from sesame import utils from django.core.mail import send_mail def login_page(request): if request.method == "POST": email = request.POST.get("emailId") user =...
en
0.318412
<p>Hi there,</p> <p>Here is your <a href="{}">magic link</a> </p> <p>Thanks,</p> <p>Django Admin</p>
2.138901
2
python-lib/config/dss_parameter.py
dataiku/dss-plugin-nlp-analysis
1
2123
from .custom_check import CustomCheck, CustomCheckError from typing import Any, List import logging logger = logging.getLogger(__name__) class DSSParameterError(Exception): """Exception raised when at least one CustomCheck fails.""" pass class DSSParameter: """Object related to one parameter. It is m...
from .custom_check import CustomCheck, CustomCheckError from typing import Any, List import logging logger = logging.getLogger(__name__) class DSSParameterError(Exception): """Exception raised when at least one CustomCheck fails.""" pass class DSSParameter: """Object related to one parameter. It is m...
en
0.365754
Exception raised when at least one CustomCheck fails. Object related to one parameter. It is mainly used for checks to run in backend for custom forms. Attributes: name(str): Name of the parameter value(Any): Value of the parameter checks(list[dict], optional): Checks to run on provided valu...
3.423957
3
misc/import_ch_zurich.py
mstarikov/transitfeed
0
2124
<filename>misc/import_ch_zurich.py #!/usr/bin/python2.4 # Copyright (C) 2008 Google 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 #...
<filename>misc/import_ch_zurich.py #!/usr/bin/python2.4 # Copyright (C) 2008 Google 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 #...
en
0.873344
#!/usr/bin/python2.4 # Copyright (C) 2008 Google 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...
2.235723
2
modules/documents.py
rotsee/protokollen
4
2125
# -*- coding: utf-8 -*- """This module contains classes for documents, and lists of documents. Documents are defined by the document rules in settings.py A file can contain one or more document. However, a document can not be constructed from more than one file. This is a limitation, obvious in cases like ...
# -*- coding: utf-8 -*- """This module contains classes for documents, and lists of documents. Documents are defined by the document rules in settings.py A file can contain one or more document. However, a document can not be constructed from more than one file. This is a limitation, obvious in cases like ...
en
0.80846
# -*- coding: utf-8 -*- This module contains classes for documents, and lists of documents. Documents are defined by the document rules in settings.py A file can contain one or more document. However, a document can not be constructed from more than one file. This is a limitation, obvious in cases like Got...
2.795697
3
tools/amp_segment/ina_speech_segmenter.py
saratkumar/galaxy
1
2126
#!/usr/bin/env python3 import os import os.path import shutil import subprocess import sys import tempfile import uuid import mgm_utils def main(): (root_dir, input_file, json_file) = sys.argv[1:4] tmpName = str(uuid.uuid4()) tmpdir = "/tmp" temp_input_file = f"{tmpdir}/{tmpName}.dat" temp_output_file = f"{tmpd...
#!/usr/bin/env python3 import os import os.path import shutil import subprocess import sys import tempfile import uuid import mgm_utils def main(): (root_dir, input_file, json_file) = sys.argv[1:4] tmpName = str(uuid.uuid4()) tmpdir = "/tmp" temp_input_file = f"{tmpdir}/{tmpName}.dat" temp_output_file = f"{tmpd...
fr
0.221828
#!/usr/bin/env python3
2.225422
2
csat/django/fields.py
GaretJax/csat
0
2127
<filename>csat/django/fields.py<gh_stars>0 from lxml import etree from django import forms from django.db import models class XMLFileField(models.FileField): def __init__(self, *args, **kwargs): self.schema = kwargs.pop('schema') super(XMLFileField, self).__init__(*args, **kwargs) def clean(...
<filename>csat/django/fields.py<gh_stars>0 from lxml import etree from django import forms from django.db import models class XMLFileField(models.FileField): def __init__(self, *args, **kwargs): self.schema = kwargs.pop('schema') super(XMLFileField, self).__init__(*args, **kwargs) def clean(...
none
1
2.286479
2
keras_cv_attention_models/yolox/yolox.py
RishabhSehgal/keras_cv_attention_models
0
2128
import tensorflow as tf from tensorflow import keras from keras_cv_attention_models.attention_layers import ( activation_by_name, batchnorm_with_activation, conv2d_no_bias, depthwise_conv2d_no_bias, add_pre_post_process, ) from keras_cv_attention_models import model_surgery from keras_cv_attention_m...
import tensorflow as tf from tensorflow import keras from keras_cv_attention_models.attention_layers import ( activation_by_name, batchnorm_with_activation, conv2d_no_bias, depthwise_conv2d_no_bias, add_pre_post_process, ) from keras_cv_attention_models import model_surgery from keras_cv_attention_m...
en
0.485573
CSPDarknet backbone # Handling odd input_shape Stem dark blocks # nn = SPPBottleneck(base_channels * 16, base_channels * 16, activation=act) path aggregation fpn # print(f">>>> upsample_merge inputs: {[ii.shape for ii in inputs] = }") # inputs[0] = keras.layers.UpSampling2D(size=(2, 2), interpolation="nearest", name=na...
1.969749
2
robot-server/tests/service/json_api/test_response.py
mrod0101/opentrons
0
2129
<filename>robot-server/tests/service/json_api/test_response.py from pytest import raises from pydantic import ValidationError from robot_server.service.json_api.response import ( ResponseDataModel, ResponseModel, MultiResponseModel, ) from tests.service.helpers import ItemResponseModel def test_attribute...
<filename>robot-server/tests/service/json_api/test_response.py from pytest import raises from pydantic import ValidationError from robot_server.service.json_api.response import ( ResponseDataModel, ResponseModel, MultiResponseModel, ) from tests.service.helpers import ItemResponseModel def test_attribute...
none
1
2.58049
3
stickmanZ/__main__.py
MichaelMcFarland98/cse210-project
1
2130
<filename>stickmanZ/__main__.py from game.game_view import GameView from game.menu_view import menu_view from game import constants import arcade SCREEN_WIDTH = constants.SCREEN_WIDTH SCREEN_HEIGHT = constants.SCREEN_HEIGHT SCREEN_TITLE = constants.SCREEN_TITLE window = arcade.Window(SCREEN_WIDTH, SCREEN_HEIGHT, SC...
<filename>stickmanZ/__main__.py from game.game_view import GameView from game.menu_view import menu_view from game import constants import arcade SCREEN_WIDTH = constants.SCREEN_WIDTH SCREEN_HEIGHT = constants.SCREEN_HEIGHT SCREEN_TITLE = constants.SCREEN_TITLE window = arcade.Window(SCREEN_WIDTH, SCREEN_HEIGHT, SC...
none
1
2.067689
2
neutron/db/migration/alembic_migrations/versions/mitaka/contract/c6c112992c9_rbac_qos_policy.py
congnt95/neutron
1,080
2131
<gh_stars>1000+ # Copyright 2015 OpenStack Foundation # # 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...
# Copyright 2015 OpenStack Foundation # # 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 ...
en
0.797089
# Copyright 2015 OpenStack Foundation # # 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 ...
1.470671
1
chapter5/ch5_gcp_subscriber.py
ericchou1/network-devops-kafka-up-and-running
1
2132
from concurrent.futures import TimeoutError from google.cloud import pubsub_v1 project_id = "pubsub-testing-331300" subscription_id = "test-sub" # Number of seconds the subscriber should listen for messages timeout = 5.0 subscriber = pubsub_v1.SubscriberClient() # The `subscription_path` method creates a fully qualif...
from concurrent.futures import TimeoutError from google.cloud import pubsub_v1 project_id = "pubsub-testing-331300" subscription_id = "test-sub" # Number of seconds the subscriber should listen for messages timeout = 5.0 subscriber = pubsub_v1.SubscriberClient() # The `subscription_path` method creates a fully qualif...
en
0.816471
# Number of seconds the subscriber should listen for messages # The `subscription_path` method creates a fully qualified identifier # in the form `projects/{project_id}/subscriptions/{subscription_id}` # Wrap subscriber in a 'with' block to automatically call close() when done. # When `timeout` is not set, result() wil...
2.797865
3
odoo-13.0/addons/google_drive/models/res_config_settings.py
VaibhavBhujade/Blockchain-ERP-interoperability
0
2133
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, fields, models, _ class ResConfigSettings(models.TransientModel): _inherit = "res.config.settings" google_drive_authorization_code = fields.Char(string='Authorization Code', config_parame...
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, fields, models, _ class ResConfigSettings(models.TransientModel): _inherit = "res.config.settings" google_drive_authorization_code = fields.Char(string='Authorization Code', config_parame...
en
0.860833
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details.
1.984739
2
dataloaders/loader.py
sanger640/attMPTI
93
2134
<filename>dataloaders/loader.py """ Data Loader for Generating Tasks Author: <NAME>, 2020 """ import os import random import math import glob import numpy as np import h5py as h5 import transforms3d from itertools import combinations import torch from torch.utils.data import Dataset def sample_K_pointclouds(data_p...
<filename>dataloaders/loader.py """ Data Loader for Generating Tasks Author: <NAME>, 2020 """ import os import random import math import glob import numpy as np import h5py as h5 import transforms3d from itertools import combinations import torch from torch.utils.data import Dataset def sample_K_pointclouds(data_p...
en
0.495333
Data Loader for Generating Tasks Author: <NAME>, 2020 sample K pointclouds and the corresponding labels for one class (one_way) #number of points in this scan # If this point cloud is for support/query set, make sure that the sampled points contain target class # indices of points belonging to the sampled class " Augm...
2.103588
2
greendoge/types/condition_with_args.py
grayfallstown/greendoge-blockchain
44
2135
from dataclasses import dataclass from typing import List from greendoge.types.condition_opcodes import ConditionOpcode from greendoge.util.streamable import Streamable, streamable @dataclass(frozen=True) @streamable class ConditionWithArgs(Streamable): """ This structure is used to store parsed CLVM conditi...
from dataclasses import dataclass from typing import List from greendoge.types.condition_opcodes import ConditionOpcode from greendoge.util.streamable import Streamable, streamable @dataclass(frozen=True) @streamable class ConditionWithArgs(Streamable): """ This structure is used to store parsed CLVM conditi...
en
0.757281
This structure is used to store parsed CLVM conditions Conditions in CLVM have either format of (opcode, var1) or (opcode, var1, var2)
2.518192
3
homeassistant/components/hunterdouglas_powerview/entity.py
pp81381/home-assistant
0
2136
"""The nexia integration base entity.""" from aiopvapi.resources.shade import ATTR_TYPE from homeassistant.const import ATTR_MODEL, ATTR_SW_VERSION import homeassistant.helpers.device_registry as dr from homeassistant.helpers.entity import DeviceInfo from homeassistant.helpers.update_coordinator import CoordinatorEnt...
"""The nexia integration base entity.""" from aiopvapi.resources.shade import ATTR_TYPE from homeassistant.const import ATTR_MODEL, ATTR_SW_VERSION import homeassistant.helpers.device_registry as dr from homeassistant.helpers.entity import DeviceInfo from homeassistant.helpers.update_coordinator import CoordinatorEnt...
en
0.786807
The nexia integration base entity. Base class for hunter douglas entities. Initialize the entity. Return the unique id. Return the device_info of the device. Base class for hunter douglas shade entities. Initialize the shade. Return the device_info of the device.
1.897882
2
keycast_env/lib/python3.8/site-packages/Xlib/ext/res.py
daxter-army/key-cast
10
2137
<reponame>daxter-army/key-cast # Xlib.ext.res -- X-Resource extension module # # Copyright (C) 2021 <NAME> <<EMAIL>> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public License # as published by the Free Software Foundation; either vers...
# Xlib.ext.res -- X-Resource extension module # # Copyright (C) 2021 <NAME> <<EMAIL>> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public License # as published by the Free Software Foundation; either version 2.1 # of the License, or (...
en
0.856369
# Xlib.ext.res -- X-Resource extension module # # Copyright (C) 2021 <NAME> <<EMAIL>> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public License # as published by the Free Software Foundation; either version 2.1 # of the License, or (at your...
1.540367
2
rubra/cmdline_args.py
scwatts/rubra
14
2138
# Process the unix command line of the pipeline. import argparse from version import rubra_version def get_cmdline_args(): return parser.parse_args() parser = argparse.ArgumentParser( description='A bioinformatics pipeline system.') parser.add_argument( 'pipeline', metavar='PIPELINE_FILE', type=...
# Process the unix command line of the pipeline. import argparse from version import rubra_version def get_cmdline_args(): return parser.parse_args() parser = argparse.ArgumentParser( description='A bioinformatics pipeline system.') parser.add_argument( 'pipeline', metavar='PIPELINE_FILE', type=...
en
0.792721
# Process the unix command line of the pipeline.
2.538666
3
main.py
KH241/Geohashing
0
2139
import webbrowser import config from Generator import Generator def main(): generator = Generator() latitude, longitude = generator.getCoordinates() webbrowser.open(config.api_request.format(latitude, longitude)) if __name__ == '__main__': main()
import webbrowser import config from Generator import Generator def main(): generator = Generator() latitude, longitude = generator.getCoordinates() webbrowser.open(config.api_request.format(latitude, longitude)) if __name__ == '__main__': main()
none
1
2.650672
3
knx-test.py
WAvdBeek/CoAPthon3
1
2140
<reponame>WAvdBeek/CoAPthon3 #!/usr/bin/env python import getopt import socket import sys import cbor #from cbor2 import dumps, loads import json import time import traceback from coapthon.client.helperclient import HelperClient from coapthon.utils import parse_uri from coapthon import defines client = None paths = {...
#!/usr/bin/env python import getopt import socket import sys import cbor #from cbor2 import dumps, loads import json import time import traceback from coapthon.client.helperclient import HelperClient from coapthon.utils import parse_uri from coapthon import defines client = None paths = {} paths_extend = {} my_base ...
en
0.461894
#!/usr/bin/env python #from cbor2 import dumps, loads # pragma: no cover # python3 knxcoapclient.py -o GET -p coap://[fe80::6513:3050:71a7:5b98]:63914/a -c 50 # add the #print ("SN : ", json_data) # installation id # sensor, e.g sending # group object table # id (0)= 1 # url (11)= /p/light # ga (7 )= 1 # cflags (8) = [...
2.280627
2
SWIM-Executables/Windows/pyinstaller-2.0 for windows/PyInstaller/hooks/hook-PyQt4.phonon.py
alexsigaras/SWIM
47
2141
hiddenimports = ['sip', 'PyQt4.QtGui', 'PyQt4._qt'] from PyInstaller.hooks.hookutils import qt4_plugins_binaries def hook(mod): mod.binaries.extend(qt4_plugins_binaries('phonon_backend')) return mod
hiddenimports = ['sip', 'PyQt4.QtGui', 'PyQt4._qt'] from PyInstaller.hooks.hookutils import qt4_plugins_binaries def hook(mod): mod.binaries.extend(qt4_plugins_binaries('phonon_backend')) return mod
none
1
1.224518
1
PyTradier/data.py
zlopez101/PyTradier
1
2142
from PyTradier.base import BasePyTradier from typing import Union from datetime import datetime class MarketData(BasePyTradier): """All Methods currently only support string API calls, no datetime, bools, etc """ def quotes(self, symbols: Union[str, list], greeks: bool = False) -> dict: """Get a ...
from PyTradier.base import BasePyTradier from typing import Union from datetime import datetime class MarketData(BasePyTradier): """All Methods currently only support string API calls, no datetime, bools, etc """ def quotes(self, symbols: Union[str, list], greeks: bool = False) -> dict: """Get a ...
en
0.734508
All Methods currently only support string API calls, no datetime, bools, etc Get a list of symbols using a keyword lookup on the symbols description. Results are in descending order by average volume of the security. This can be used for simple search functions :param symbols: Comma-delimited list of symbols (...
2.885447
3
joulescope_ui/meter_widget.py
Axel-Jacobsen/pyjoulescope_ui
1
2143
<filename>joulescope_ui/meter_widget.py # Copyright 2018 Jetperch 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...
<filename>joulescope_ui/meter_widget.py # Copyright 2018 Jetperch 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...
en
0.8284
# Copyright 2018 Jetperch 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 writing,...
2.046988
2
rpyc/core/service.py
bbonf/rpyc
0
2144
""" Services are the heart of RPyC: each side of the connection exposes a *service*, which define the capabilities available to the other side. Note that the services by both parties need not be symmetric, e.g., one side may exposed *service A*, while the other may expose *service B*. As long as the two can interopera...
""" Services are the heart of RPyC: each side of the connection exposes a *service*, which define the capabilities available to the other side. Note that the services by both parties need not be symmetric, e.g., one side may exposed *service A*, while the other may expose *service B*. As long as the two can interopera...
en
0.779343
Services are the heart of RPyC: each side of the connection exposes a *service*, which define the capabilities available to the other side. Note that the services by both parties need not be symmetric, e.g., one side may exposed *service A*, while the other may expose *service B*. As long as the two can interoperate, ...
2.728379
3
tests/task/manager_test.py
altenia/taskmator
2
2145
<filename>tests/task/manager_test.py import unittest from testbase import TaskmatorTestBase from taskmator.task import core, util from taskmator import context class ManagerTest(TaskmatorTestBase): def testManager(self): print ("Pending") def main(): unittest.main() if __name__ == '__main_...
<filename>tests/task/manager_test.py import unittest from testbase import TaskmatorTestBase from taskmator.task import core, util from taskmator import context class ManagerTest(TaskmatorTestBase): def testManager(self): print ("Pending") def main(): unittest.main() if __name__ == '__main_...
none
1
2.060037
2
tests/components/zwave_js/test_discovery.py
tbarbette/core
1
2146
<filename>tests/components/zwave_js/test_discovery.py """Test discovery of entities for device-specific schemas for the Z-Wave JS integration.""" async def test_iblinds_v2(hass, client, iblinds_v2, integration): """Test that an iBlinds v2.0 multilevel switch value is discovered as a cover.""" node = iblinds_v...
<filename>tests/components/zwave_js/test_discovery.py """Test discovery of entities for device-specific schemas for the Z-Wave JS integration.""" async def test_iblinds_v2(hass, client, iblinds_v2, integration): """Test that an iBlinds v2.0 multilevel switch value is discovered as a cover.""" node = iblinds_v...
en
0.833339
Test discovery of entities for device-specific schemas for the Z-Wave JS integration. Test that an iBlinds v2.0 multilevel switch value is discovered as a cover. Test GE 12730 Fan Controller v2.0 multilevel switch is discovered as a fan. Test LZW36 Fan Controller multilevel switch endpoint 2 is discovered as a fan.
1.933097
2
boto3_type_annotations/boto3_type_annotations/guardduty/client.py
cowboygneox/boto3_type_annotations
119
2147
<filename>boto3_type_annotations/boto3_type_annotations/guardduty/client.py from typing import Optional from botocore.client import BaseClient from typing import Dict from typing import Union from botocore.paginate import Paginator from botocore.waiter import Waiter from typing import List class Client(BaseClient): ...
<filename>boto3_type_annotations/boto3_type_annotations/guardduty/client.py from typing import Optional from botocore.client import BaseClient from typing import Dict from typing import Union from botocore.paginate import Paginator from botocore.waiter import Waiter from typing import List class Client(BaseClient): ...
none
1
2.136314
2
test/workload/tpch_loop_workload_test.py
ChenYi015/Raven
1
2148
<gh_stars>1-10 # 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 app...
# 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 ...
2.423744
2
Final-Project/server/art/serializers.py
wendy006/Web-Dev-Course
0
2149
from rest_framework import serializers from .models import * class CollectionSerializer(serializers.ModelSerializer): class Meta: model = Collection fields = ('collectionID', 'name', 'display_name', 'description', 'img_url') class ArtSerializer(serializers.ModelSerializer): img_url = ...
from rest_framework import serializers from .models import * class CollectionSerializer(serializers.ModelSerializer): class Meta: model = Collection fields = ('collectionID', 'name', 'display_name', 'description', 'img_url') class ArtSerializer(serializers.ModelSerializer): img_url = ...
none
1
2.399099
2
google/cloud/google_cloud_cpp_common_unit_tests.bzl
joezqren/google-cloud-cpp
0
2150
<filename>google/cloud/google_cloud_cpp_common_unit_tests.bzl # Copyright 2018 Google 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 # # https://www.apache.org/licenses/LICENSE-2.0 #...
<filename>google/cloud/google_cloud_cpp_common_unit_tests.bzl # Copyright 2018 Google 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 # # https://www.apache.org/licenses/LICENSE-2.0 #...
en
0.826887
# Copyright 2018 Google 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
1.207331
1
api/tests/ver1/test_base.py
codacy-badger/politico-api
0
2151
<filename>api/tests/ver1/test_base.py import unittest from api import create_app class TestBase(unittest.TestCase): """Default super class for api ver 1 tests""" # setup testing def setUp(self): self.app = create_app('testing') self.client = self.app.test_client() self.item_list = ...
<filename>api/tests/ver1/test_base.py import unittest from api import create_app class TestBase(unittest.TestCase): """Default super class for api ver 1 tests""" # setup testing def setUp(self): self.app = create_app('testing') self.client = self.app.test_client() self.item_list = ...
en
0.560119
Default super class for api ver 1 tests # setup testing # deconstructs test elements
2.52388
3
socialdistribution/app/templatetags/filters.py
CMPUT404-Project-Group/CMPUT404-Group-Project
0
2152
from django import template from django.template.defaultfilters import stringfilter from django.utils.safestring import SafeString import markdown import urllib register = template.Library() @register.filter def strip_space(value): return value.replace(' ', '') @register.filter @stringfilter def commonmark(value...
from django import template from django.template.defaultfilters import stringfilter from django.utils.safestring import SafeString import markdown import urllib register = template.Library() @register.filter def strip_space(value): return value.replace(' ', '') @register.filter @stringfilter def commonmark(value...
en
0.750412
gets the post id from the comment page url
2.283518
2
alipay/aop/api/domain/MetroOdItem.py
antopen/alipay-sdk-python-all
213
2153
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * from alipay.aop.api.domain.CloudbusUserInfo import CloudbusUserInfo class MetroOdItem(object): def __init__(self): self._dest_geo = None self._od = None self._time = None ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * from alipay.aop.api.domain.CloudbusUserInfo import CloudbusUserInfo class MetroOdItem(object): def __init__(self): self._dest_geo = None self._od = None self._time = None ...
en
0.352855
#!/usr/bin/env python # -*- coding: utf-8 -*-
2.042557
2
djangocms_redirect/migrations/0003_auto_20190810_1009.py
vsalat/djangocms-redirect
0
2154
<reponame>vsalat/djangocms-redirect # Generated by Django 2.2.4 on 2019-08-10 08:09 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('djangocms_redirect', '0002_auto_20170321_1807'), ] operations = [ migrations.AddField( model...
# Generated by Django 2.2.4 on 2019-08-10 08:09 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('djangocms_redirect', '0002_auto_20170321_1807'), ] operations = [ migrations.AddField( model_name='redirect', name='...
en
0.678064
# Generated by Django 2.2.4 on 2019-08-10 08:09
1.942017
2
octopart/scrape_octopart.py
nicholaschiang/dl-datasheets
0
2155
#! /usr/bin/env python import sys import json import urllib import urllib2 import time import argparse import re # Category ID for Discrete Semiconductors > Transistors > BJTs TRANSISTOR_ID = b814751e89ff63d3 def find_total_hits(search_query): """ Function: find_total_hits -------------------- Return...
#! /usr/bin/env python import sys import json import urllib import urllib2 import time import argparse import re # Category ID for Discrete Semiconductors > Transistors > BJTs TRANSISTOR_ID = b814751e89ff63d3 def find_total_hits(search_query): """ Function: find_total_hits -------------------- Return...
en
0.696206
#! /usr/bin/env python # Category ID for Discrete Semiconductors > Transistors > BJTs Function: find_total_hits -------------------- Returns the number of hits that correspond to the search query. # NOTE: Use your API key here (https://octopart.com/api/register) #change to increase number of datasheets # perfor...
3.181013
3
extras/python/fogbench/__main__.py
foglamp/FogLAMP
65
2156
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # FOGLAMP_BEGIN # See: http://foglamp.readthedocs.io/ # FOGLAMP_END """ fogbench -- a Python script used to test FogLAMP. The objective is to simulate payloads for input, REST and other requests against one or more FogLAMP instances. This version of fogbench is meant ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # FOGLAMP_BEGIN # See: http://foglamp.readthedocs.io/ # FOGLAMP_END """ fogbench -- a Python script used to test FogLAMP. The objective is to simulate payloads for input, REST and other requests against one or more FogLAMP instances. This version of fogbench is meant ...
en
0.494595
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # FOGLAMP_BEGIN # See: http://foglamp.readthedocs.io/ # FOGLAMP_END fogbench -- a Python script used to test FogLAMP. The objective is to simulate payloads for input, REST and other requests against one or more FogLAMP instances. This version of fogbench is meant to test ...
2.275312
2
qiskit/ignis/mitigation/measurement/filters.py
paulineollitrault/qiskit-ignis
182
2157
<reponame>paulineollitrault/qiskit-ignis<gh_stars>100-1000 # -*- coding: utf-8 -*- # This code is part of Qiskit. # # (C) Copyright IBM 2019. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or a...
# -*- coding: utf-8 -*- # This code is part of Qiskit. # # (C) Copyright IBM 2019. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modif...
en
0.806603
# -*- coding: utf-8 -*- # This code is part of Qiskit. # # (C) Copyright IBM 2019. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifi...
2.244753
2
pymatgen/analysis/graphs.py
Roy027/pymatgen
0
2158
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. """ Module for graph representations of crystals. """ import copy import logging import os.path import subprocess import warnings from collections import defaultdict, namedtuple from itertools import combinati...
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. """ Module for graph representations of crystals. """ import copy import logging import os.path import subprocess import warnings from collections import defaultdict, namedtuple from itertools import combinati...
en
0.824413
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. Module for graph representations of crystals. Helper function called by isomorphic to ensure comparison of node identities. Helper function that converts a networkx graph object into an igraph graph object. Inte...
2.185122
2
maple/backend/singularity/__init__.py
akashdhruv/maple
0
2159
from . import image from . import container from . import system
from . import image from . import container from . import system
none
1
1.098911
1
articles/views.py
Ahmed-skb/blogyfy
0
2160
from django.shortcuts import render, redirect from django.http import HttpResponse from .models import Article from django.contrib.auth.decorators import login_required from . import forms def Articles(request): articles = Article.objects.all().order_by('date') return render(request, 'articles/article_list.htm...
from django.shortcuts import render, redirect from django.http import HttpResponse from .models import Article from django.contrib.auth.decorators import login_required from . import forms def Articles(request): articles = Article.objects.all().order_by('date') return render(request, 'articles/article_list.htm...
en
0.39059
# return HttpResponse(slug) #save article to DB
2.258271
2
sifter/grammar/grammar.py
russell/sifter
0
2161
<gh_stars>0 # Parser based on RFC 5228, especially the grammar as defined in section 8. All # references are to sections in RFC 5228 unless stated otherwise. import ply.yacc import sifter.grammar from sifter.grammar.lexer import tokens import sifter.handler import logging __all__ = ('parser',) def parser(**kwargs)...
# Parser based on RFC 5228, especially the grammar as defined in section 8. All # references are to sections in RFC 5228 unless stated otherwise. import ply.yacc import sifter.grammar from sifter.grammar.lexer import tokens import sifter.handler import logging __all__ = ('parser',) def parser(**kwargs): return...
en
0.353832
# Parser based on RFC 5228, especially the grammar as defined in section 8. All # references are to sections in RFC 5228 unless stated otherwise. commands : commands command # section 3.2: REQUIRE command must come before any other commands # section 3.1: ELSIF and ELSE must follow IF or another ELSIF commands : comman...
2.653692
3
multidoc_mnb.py
dropofwill/author-attr-experiments
2
2162
<gh_stars>1-10 from sklearn import datasets from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.feature_extraction.text import CountVectorizer from sklearn.cross_validation import train_test_split from sklearn.cross_validation import cross_val_score from sklearn.cross_validation import ShuffleSpli...
from sklearn import datasets from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.feature_extraction.text import CountVectorizer from sklearn.cross_validation import train_test_split from sklearn.cross_validation import cross_val_score from sklearn.cross_validation import ShuffleSplit from sklearn....
en
0.534098
# Calculates the mean of the scores with the standard deviation # Load documents # Select Features via Bag of Words approach without stop words #X = CountVectorizer(charset_error='ignore', stop_words='english', strip_accents='unicode', ).fit_transform(X) # sklearn's grid search #scores = cross_val_score(mnb_gv, X, y, c...
2.718624
3
tabular/__init__.py
yamins81/tabular
6
2163
import io import fast import spreadsheet import tab import utils import web from io import * from fast import * from spreadsheet import * from tab import * from utils import * from web import * __all__ = [] __all__.extend(io.__all__) __all__.extend(fast.__all__) __all__.extend(spreadsheet.__all__) __all__.extend(tab....
import io import fast import spreadsheet import tab import utils import web from io import * from fast import * from spreadsheet import * from tab import * from utils import * from web import * __all__ = [] __all__.extend(io.__all__) __all__.extend(fast.__all__) __all__.extend(spreadsheet.__all__) __all__.extend(tab....
none
1
1.319672
1
smipyping/_targetstable.py
KSchopmeyer/smipyping
0
2164
# (C) Copyright 2017 Inova Development Inc. # 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 appl...
# (C) Copyright 2017 Inova Development Inc. # 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 appl...
en
0.743139
# (C) Copyright 2017 Inova Development Inc. # 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 appl...
1.735705
2
dev/Code/Framework/AzFramework/CodeGen/AzEBusInline.py
jeikabu/lumberyard
1,738
2165
# # All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or # its licensors. # # For complete copyright and license terms please see the LICENSE at the root of this # distribution (the "License"). All use of this software is governed by the License, # or, if provided, by the license below or th...
# # All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or # its licensors. # # For complete copyright and license terms please see the LICENSE at the root of this # distribution (the "License"). All use of this software is governed by the License, # or, if provided, by the license below or th...
en
0.883583
# # All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or # its licensors. # # For complete copyright and license terms please see the LICENSE at the root of this # distribution (the "License"). All use of this software is governed by the License, # or, if provided, by the license below or th...
1.902204
2
QUANTAXIS/QASU/crawl_eastmoney.py
QUANTAXISER/QUANTAXIS
1
2166
import os from QUANTAXIS.QASetting import QALocalize #from QUANTAXIS_CRAWLY.run_selenium_alone import (read_east_money_page_zjlx_to_sqllite, open_chrome_driver, close_chrome_dirver) from QUANTAXIS_CRAWLY.run_selenium_alone import * import urllib import pandas as pd import time from QUANTAXIS.QAUtil import (DATABASE) ...
import os from QUANTAXIS.QASetting import QALocalize #from QUANTAXIS_CRAWLY.run_selenium_alone import (read_east_money_page_zjlx_to_sqllite, open_chrome_driver, close_chrome_dirver) from QUANTAXIS_CRAWLY.run_selenium_alone import * import urllib import pandas as pd import time from QUANTAXIS.QAUtil import (DATABASE) ...
zh
0.277016
#from QUANTAXIS_CRAWLY.run_selenium_alone import (read_east_money_page_zjlx_to_sqllite, open_chrome_driver, close_chrome_dirver) # 改用 # 延时 # 🛠todo 改用 re 正则表达式做匹配 #for aline in string_lines: # aline = aline.strip() # if '_stockCode' in aline: # _stockCode = aline[len('var _stockCode = '):] # _stockCode = _stock...
2.651835
3
wsgi.py
javicacheiro/salt-git-synchronizer-proxy
0
2167
#!/usr/bin/env python import logging import sys from app import app as application def setup_flask_logging(): # Log to stdout handler = logging.StreamHandler(sys.stdout) # Log to a file #handler = logging.FileHandler('./application.log') handler.setLevel(logging.INFO) handler.setFormatter(logg...
#!/usr/bin/env python import logging import sys from app import app as application def setup_flask_logging(): # Log to stdout handler = logging.StreamHandler(sys.stdout) # Log to a file #handler = logging.FileHandler('./application.log') handler.setLevel(logging.INFO) handler.setFormatter(logg...
en
0.590947
#!/usr/bin/env python # Log to stdout # Log to a file #handler = logging.FileHandler('./application.log') # Set default log level for the general logger # each handler can then restrict the messages logged
2.668327
3
game/base/enemy.py
PythonixCoders/PyWeek29
8
2168
<gh_stars>1-10 #!/usr/bin/env python from game.base.being import Being class Enemy(Being): def __init__(self, app, scene, **kwargs): super().__init__(app, scene, **kwargs) self.friendly = False
#!/usr/bin/env python from game.base.being import Being class Enemy(Being): def __init__(self, app, scene, **kwargs): super().__init__(app, scene, **kwargs) self.friendly = False
ru
0.26433
#!/usr/bin/env python
2.349034
2
main/rates/migrations/0002_auto_20170625_1510.py
Hawk94/coin_tracker
0
2169
# -*- coding: utf-8 -*- # Generated by Django 1.11.1 on 2017-06-25 15:10 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('rates', '0001_initial'), ] operations = [ migrations.RenameField( model...
# -*- coding: utf-8 -*- # Generated by Django 1.11.1 on 2017-06-25 15:10 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('rates', '0001_initial'), ] operations = [ migrations.RenameField( model...
en
0.703533
# -*- coding: utf-8 -*- # Generated by Django 1.11.1 on 2017-06-25 15:10
1.685258
2
setup.py
dojeda/quetzal-openapi-client
0
2170
# coding: utf-8 """ Quetzal API Quetzal: an API to manage data files and their associated metadata. OpenAPI spec version: 0.5.0 Contact: <EMAIL> Generated by: https://openapi-generator.tech """ from setuptools import setup, find_packages # noqa: H301 NAME = "quetzal-openapi-client" VERSION = ...
# coding: utf-8 """ Quetzal API Quetzal: an API to manage data files and their associated metadata. OpenAPI spec version: 0.5.0 Contact: <EMAIL> Generated by: https://openapi-generator.tech """ from setuptools import setup, find_packages # noqa: H301 NAME = "quetzal-openapi-client" VERSION = ...
en
0.752748
# coding: utf-8 Quetzal API Quetzal: an API to manage data files and their associated metadata. OpenAPI spec version: 0.5.0 Contact: <EMAIL> Generated by: https://openapi-generator.tech # noqa: H301 # To install the library, run the following # # python setup.py install # # prerequisite: setuptools # ...
1.526837
2
youtube_dl/extractor/turner.py
jonyg80/youtube-dl
66,635
2171
# coding: utf-8 from __future__ import unicode_literals import re from .adobepass import AdobePassIE from ..compat import compat_str from ..utils import ( fix_xml_ampersands, xpath_text, int_or_none, determine_ext, float_or_none, parse_duration, xpath_attr, update_url_query, Extrac...
# coding: utf-8 from __future__ import unicode_literals import re from .adobepass import AdobePassIE from ..compat import compat_str from ..utils import ( fix_xml_ampersands, xpath_text, int_or_none, determine_ext, float_or_none, parse_duration, xpath_attr, update_url_query, Extrac...
en
0.398127
# coding: utf-8 # rtmp_src = xpath_text(video_data, 'akamai/src') # if rtmp_src: # split_rtmp_src = rtmp_src.split(',') # if len(split_rtmp_src) == 2: # rtmp_src = split_rtmp_src[1] # aifp = xpath_text(video_data, 'akamai/aifp', default='') # Possible formats locations: files/file, files/groupFiles/file...
2.081432
2
ml/sandbox/00-data.py
robk-dev/algo-trading
1
2172
from alpha_vantage.timeseries import TimeSeries from pprint import pprint import json import argparse def save_dataset(symbol='MSFT', time_window='daily_adj'): credentials = json.load(open('creds.json', 'r')) api_key = credentials['av_api_key'] print(symbol, time_window) ts = TimeSeries(key=api_key, o...
from alpha_vantage.timeseries import TimeSeries from pprint import pprint import json import argparse def save_dataset(symbol='MSFT', time_window='daily_adj'): credentials = json.load(open('creds.json', 'r')) api_key = credentials['av_api_key'] print(symbol, time_window) ts = TimeSeries(key=api_key, o...
none
1
3.04529
3
tests/zpill.py
al3pht/cloud-custodian
2,415
2173
<gh_stars>1000+ # Copyright The Cloud Custodian Authors. # SPDX-License-Identifier: Apache-2.0 import fnmatch from io import StringIO import json import os import shutil import zipfile import re from datetime import datetime, timedelta, tzinfo from distutils.util import strtobool import boto3 import placebo from botoc...
# Copyright The Cloud Custodian Authors. # SPDX-License-Identifier: Apache-2.0 import fnmatch from io import StringIO import json import os import shutil import zipfile import re from datetime import datetime, timedelta, tzinfo from distutils.util import strtobool import boto3 import placebo from botocore.response imp...
en
0.775347
# Copyright The Cloud Custodian Authors. # SPDX-License-Identifier: Apache-2.0 # Custodian Test Account. This is used only for testing. # Access is available for community project maintainers. ########################################################################### # BEGIN PLACEBO MONKEY PATCH # # Placebo is effecti...
1.690725
2
flexget/tests/test_next_series_seasons.py
metaMMA/Flexget
0
2174
<gh_stars>0 from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin import pytest from flexget.entry import Entry # TODO Add more standard tests class TestNextSeriesSeasonSeasonsPack(object): _config = """ templat...
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin import pytest from flexget.entry import Entry # TODO Add more standard tests class TestNextSeriesSeasonSeasonsPack(object): _config = """ templates: ...
en
0.481056
# noqa pylint: disable=unused-import, redefined-builtin # TODO Add more standard tests templates: global: parsing: series: internal anchors: _nss_backfill: &nss_backfill next_series_seasons: backfill: yes _nss_from_start...
1.673885
2
pymatgen/analysis/wulff.py
hpatel1567/pymatgen
1
2175
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. """ This module define a WulffShape class to generate the Wulff shape from a lattice, a list of indices and their corresponding surface energies, and the total area and volume of the wulff shape,the weighted su...
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. """ This module define a WulffShape class to generate the Wulff shape from a lattice, a list of indices and their corresponding surface energies, and the total area and volume of the wulff shape,the weighted su...
en
0.706762
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. This module define a WulffShape class to generate the Wulff shape from a lattice, a list of indices and their corresponding surface energies, and the total area and volume of the wulff shape,the weighted surface...
3.270233
3
ccg/supertagger/any2int.py
stanojevic/ccgtools
0
2176
class Any2Int: def __init__(self, min_count: int, include_UNK: bool, include_PAD: bool): self.min_count = min_count self.include_UNK = include_UNK self.include_PAD = include_PAD self.frozen = False self.UNK_i = -1 self.UNK_s = "<UNK>" self.PAD_i = -2 ...
class Any2Int: def __init__(self, min_count: int, include_UNK: bool, include_PAD: bool): self.min_count = min_count self.include_UNK = include_UNK self.include_PAD = include_PAD self.frozen = False self.UNK_i = -1 self.UNK_s = "<UNK>" self.PAD_i = -2 ...
none
1
3.160004
3
app/sensor.py
sosprz/nettemp
51
2177
<gh_stars>10-100 from app import app from flask import Flask, request, jsonify, g import sqlite3 import os import json from random import randint from flask_jwt_extended import jwt_required import datetime from flask_mysqldb import MySQL mysql = MySQL() def get_db(rom): db = getattr(g, '_database', None) if db...
from app import app from flask import Flask, request, jsonify, g import sqlite3 import os import json from random import randint from flask_jwt_extended import jwt_required import datetime from flask_mysqldb import MySQL mysql = MySQL() def get_db(rom): db = getattr(g, '_database', None) if db is None: ...
en
0.388277
# stat min max
2.68206
3
tests/either_catch_test.py
funnel-io/python-on-rails
1
2178
from python_on_rails.either import as_either, Failure, Success @as_either(TypeError) def add_one(x): return x + 1 @as_either() def times_five(x): return x * 5 def test_success_executes_bindings(): result = Success(1).bind(add_one).bind(times_five) assert isinstance(result, Success) assert resu...
from python_on_rails.either import as_either, Failure, Success @as_either(TypeError) def add_one(x): return x + 1 @as_either() def times_five(x): return x * 5 def test_success_executes_bindings(): result = Success(1).bind(add_one).bind(times_five) assert isinstance(result, Success) assert resu...
none
1
2.74656
3
ServerSide/models.py
Coullence/DRF_Percels-Couriers_API_V.0.0.2
0
2179
from django.db import models # Create your models here. # Station class Stations(models.Model): stationName = models.CharField(max_length=100) stationLocation = models.CharField(max_length=100) stationStaffId = models.CharField(max_length=100) date = models.DateTimeField(auto_now_add=True) d...
from django.db import models # Create your models here. # Station class Stations(models.Model): stationName = models.CharField(max_length=100) stationLocation = models.CharField(max_length=100) stationStaffId = models.CharField(max_length=100) date = models.DateTimeField(auto_now_add=True) d...
en
0.936202
# Create your models here. # Station # Customers # Items # Payments
2.239941
2
tao_compiler/mlir/disc/tests/glob_op_test.bzl
JamesTheZ/BladeDISC
328
2180
# Test definitions for Lit, the LLVM test runner. # # This is reusing the LLVM Lit test runner in the interim until the new build # rules are upstreamed. # TODO(b/136126535): remove this custom rule. """Lit runner globbing test """ load("//tensorflow:tensorflow.bzl", "filegroup") load("@bazel_skylib//lib:paths.bzl", "...
# Test definitions for Lit, the LLVM test runner. # # This is reusing the LLVM Lit test runner in the interim until the new build # rules are upstreamed. # TODO(b/136126535): remove this custom rule. """Lit runner globbing test """ load("//tensorflow:tensorflow.bzl", "filegroup") load("@bazel_skylib//lib:paths.bzl", "...
en
0.838794
# Test definitions for Lit, the LLVM test runner. # # This is reusing the LLVM Lit test runner in the interim until the new build # rules are upstreamed. # TODO(b/136126535): remove this custom rule. Lit runner globbing test # Default values used by the test runner. # These are patterns which we should never match, for...
1.547668
2
build-scripts/PackageCheckHelpers.py
yulicrunchy/JALoP
4
2181
""" These are functions to add to the configure context. """ def __checkCanLink(context, source, source_type, message_libname, real_libs=[]): """ Check that source can be successfully compiled and linked against real_libs. Keyword arguments: source -- source to try to compile source_type -- type of source file, ...
""" These are functions to add to the configure context. """ def __checkCanLink(context, source, source_type, message_libname, real_libs=[]): """ Check that source can be successfully compiled and linked against real_libs. Keyword arguments: source -- source to try to compile source_type -- type of source file, ...
en
0.396398
These are functions to add to the configure context. Check that source can be successfully compiled and linked against real_libs. Keyword arguments: source -- source to try to compile source_type -- type of source file, (probably should be ".c") message_libname -- library name to show in the message output from sc...
2.419839
2
src/transformers/modeling_tf_pytorch_utils.py
ari-holtzman/transformers
5,129
2182
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, <NAME>. 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 Lic...
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, <NAME>. 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 Lic...
en
0.793437
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, <NAME>. 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 Lic...
2.276686
2
hail/python/test/hail/helpers.py
mitochon/hail
0
2183
<gh_stars>0 import os from timeit import default_timer as timer import unittest import pytest from decorator import decorator from hail.utils.java import Env import hail as hl from hail.backend.local_backend import LocalBackend _initialized = False def startTestHailContext(): global _initialized if not _ini...
import os from timeit import default_timer as timer import unittest import pytest from decorator import decorator from hail.utils.java import Env import hail as hl from hail.backend.local_backend import LocalBackend _initialized = False def startTestHailContext(): global _initialized if not _initialized: ...
en
0.537506
# force initialization
1.96161
2
src/entity_linker/models/figer_model/labeling_model.py
mjstrobl/WEXEA
10
2184
<filename>src/entity_linker/models/figer_model/labeling_model.py """ Modifications copyright (C) 2020 <NAME> """ import time import tensorflow as tf import numpy as np from entity_linker.models.base import Model class LabelingModel(Model): """Unsupervised Clustering using Discrete-State VAE""" def __init__(...
<filename>src/entity_linker/models/figer_model/labeling_model.py """ Modifications copyright (C) 2020 <NAME> """ import time import tensorflow as tf import numpy as np from entity_linker.models.base import Model class LabelingModel(Model): """Unsupervised Clustering using Discrete-State VAE""" def __init__(...
en
0.467495
Modifications copyright (C) 2020 <NAME> Unsupervised Clustering using Discrete-State VAE # [B, L] ### PREDICT TYPES FROM ENTITIES #true_entity_embeddings = tf.nn.dropout(true_entity_embeddings, keep_prob=0.5) # [B, L]
2.051608
2
python/molecular_diameter.py
wutobias/collection
2
2185
<gh_stars>1-10 #!/usr/bin/env python import sys import parmed as pmd import numpy as np from scipy.spatial import distance if len(sys.argv) < 2: print "Usage: molecular_diameter.py <mymolecule.mol2>" exit(1) mol = pmd.load_file(sys.argv[1]) crds = mol.coordinates dist = distance.cdist(crds, crds, 'euclidean') pr...
#!/usr/bin/env python import sys import parmed as pmd import numpy as np from scipy.spatial import distance if len(sys.argv) < 2: print "Usage: molecular_diameter.py <mymolecule.mol2>" exit(1) mol = pmd.load_file(sys.argv[1]) crds = mol.coordinates dist = distance.cdist(crds, crds, 'euclidean') print np.max(dist...
ru
0.26433
#!/usr/bin/env python
2.60008
3
examples/text_classification/yelp_reviews_polarity/train.py
liorshk/simpletransformers
3,151
2186
<reponame>liorshk/simpletransformers<gh_stars>1000+ import sys import pandas as pd from simpletransformers.classification import ClassificationModel prefix = "data/" train_df = pd.read_csv(prefix + "train.csv", header=None) train_df.head() eval_df = pd.read_csv(prefix + "test.csv", header=None) eval_df.head() tra...
import sys import pandas as pd from simpletransformers.classification import ClassificationModel prefix = "data/" train_df = pd.read_csv(prefix + "train.csv", header=None) train_df.head() eval_df = pd.read_csv(prefix + "test.csv", header=None) eval_df.head() train_df[0] = (train_df[0] == 2).astype(int) eval_df[0]...
en
0.423413
# "use_early_stopping": True, # "early_stopping_metric": "mcc", # "n_gpu": 2, # "manual_seed": 4, # "use_multiprocessing": False, # "config": { # "output_hidden_states": True # } # Create a ClassificationModel # Train the model # # # Evaluate the model # result, model_outputs, wrong_predictions = model.eval_model(e...
2.952934
3
LoadGraph.py
mahdi-zafarmand/SNA
0
2187
<reponame>mahdi-zafarmand/SNA import networkx as nx import os.path def load_graph(path, weighted=False, delimiter='\t', self_loop=False): graph = nx.Graph() if not os.path.isfile(path): print("Error: file " + path + " not found!") exit(-1) with open(path) as file: for line in file.readlines(): w = 1.0 ...
import networkx as nx import os.path def load_graph(path, weighted=False, delimiter='\t', self_loop=False): graph = nx.Graph() if not os.path.isfile(path): print("Error: file " + path + " not found!") exit(-1) with open(path) as file: for line in file.readlines(): w = 1.0 line = line.split(delimiter) ...
none
1
3.215834
3
mayan/apps/document_signatures/models.py
wan1869/dushuhu
0
2188
import logging import uuid from django.db import models from django.urls import reverse from django.utils.encoding import force_text from django.utils.translation import ugettext_lazy as _ from model_utils.managers import InheritanceManager from mayan.apps.django_gpg.exceptions import VerificationError from mayan.ap...
import logging import uuid from django.db import models from django.urls import reverse from django.utils.encoding import force_text from django.utils.translation import ugettext_lazy as _ from model_utils.managers import InheritanceManager from mayan.apps.django_gpg.exceptions import VerificationError from mayan.ap...
en
0.816281
Fields: * key_id - Key Identifier - This is what identifies uniquely a key. Not two keys in the world have the same Key ID. The Key ID is also used to locate a key in the key servers: http://pgp.mit.edu * signature_id - Signature ID - Every time a key is used to sign something it will generate a uni...
2.153223
2
scripts/sync_reports_config.py
ramezrawas/galaxy-1
6
2189
from ConfigParser import ConfigParser from sys import argv REPLACE_PROPERTIES = ["file_path", "database_connection", "new_file_path"] MAIN_SECTION = "app:main" def sync(): # Add or replace the relevant properites from galaxy.ini # into reports.ini reports_config_file = "config/reports.ini" if len(arg...
from ConfigParser import ConfigParser from sys import argv REPLACE_PROPERTIES = ["file_path", "database_connection", "new_file_path"] MAIN_SECTION = "app:main" def sync(): # Add or replace the relevant properites from galaxy.ini # into reports.ini reports_config_file = "config/reports.ini" if len(arg...
en
0.890113
# Add or replace the relevant properites from galaxy.ini # into reports.ini # Write all properties from reports config replacing as # needed. # If any properties appear in universe config and not in # reports write these as well. # Cycle through properties to replace and perform replacement on # this line if needed.
2.945466
3
src/gausskernel/dbmind/xtuner/test/test_ssh.py
wotchin/openGauss-server
1
2190
# Copyright (c) 2020 Huawei Technologies Co.,Ltd. # # openGauss is licensed under Mulan PSL v2. # You can use this software according to the terms and conditions of the Mulan PSL v2. # You may obtain a copy of Mulan PSL v2 at: # # http://license.coscl.org.cn/MulanPSL2 # # THIS SOFTWARE IS PROVIDED ON AN "AS IS...
# Copyright (c) 2020 Huawei Technologies Co.,Ltd. # # openGauss is licensed under Mulan PSL v2. # You can use this software according to the terms and conditions of the Mulan PSL v2. # You may obtain a copy of Mulan PSL v2 at: # # http://license.coscl.org.cn/MulanPSL2 # # THIS SOFTWARE IS PROVIDED ON AN "AS IS...
en
0.469583
# Copyright (c) 2020 Huawei Technologies Co.,Ltd. # # openGauss is licensed under Mulan PSL v2. # You can use this software according to the terms and conditions of the Mulan PSL v2. # You may obtain a copy of Mulan PSL v2 at: # # http://license.coscl.org.cn/MulanPSL2 # # THIS SOFTWARE IS PROVIDED ON AN "AS IS...
1.826701
2
models/utils.py
wyshi/Unsupervised-Structure-Learning
34
2191
<reponame>wyshi/Unsupervised-Structure-Learning<gh_stars>10-100 # Original work Copyright (C) 2017 <NAME>, Carnegie Mellon University # Modified work Copyright 2018 <NAME>. import tensorflow as tf import numpy as np from nltk.translate.bleu_score import sentence_bleu from nltk.translate.bleu_score import SmoothingFunc...
# Original work Copyright (C) 2017 <NAME>, Carnegie Mellon University # Modified work Copyright 2018 <NAME>. import tensorflow as tf import numpy as np from nltk.translate.bleu_score import sentence_bleu from nltk.translate.bleu_score import SmoothingFunction def get_bleu_stats(ref, hyps): scores = [] for hy...
en
0.804034
# Original work Copyright (C) 2017 <NAME>, Carnegie Mellon University # Modified work Copyright 2018 <NAME>. Assumption, the last dimension is the embedding The second last dimension is the sentence length. The rank must be 3 Assumption, the last dimension is the embedding The second last dimension is the sente...
2.495771
2
gluoncv/data/transforms/block.py
Kh4L/gluon-cv
5,447
2192
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
en
0.769895
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
2.107276
2
explore.py
lribiere/explore-mit-bih-arrhythmia-db
3
2193
import plotly.graph_objects as go import streamlit as st import pandas as pd from utils import * import glob import wfdb import os ANNOTATIONS_COL_NAME = 'annotations' ''' # MIT-BIH Arrhythmia DB Exploration ''' record_ids = [os.path.basename(file)[:-4] for file in glob.glob('data/*.dat')] if len(record_ids) == 0: ...
import plotly.graph_objects as go import streamlit as st import pandas as pd from utils import * import glob import wfdb import os ANNOTATIONS_COL_NAME = 'annotations' ''' # MIT-BIH Arrhythmia DB Exploration ''' record_ids = [os.path.basename(file)[:-4] for file in glob.glob('data/*.dat')] if len(record_ids) == 0: ...
en
0.613518
# MIT-BIH Arrhythmia DB Exploration ## Annotations # Plot counts for each annotation ## Explore full dataset # Plot signals and annotations
2.569272
3
release/stubs.min/System/__init___parts/CharEnumerator.py
tranconbv/ironpython-stubs
0
2194
class CharEnumerator(object): """ Supports iterating over a System.String object and reading its individual characters. This class cannot be inherited. """ def ZZZ(self): """hardcoded/mock instance of the class""" return CharEnumerator() instance=ZZZ() """hardcoded/returns an instance of the class""" de...
class CharEnumerator(object): """ Supports iterating over a System.String object and reading its individual characters. This class cannot be inherited. """ def ZZZ(self): """hardcoded/mock instance of the class""" return CharEnumerator() instance=ZZZ() """hardcoded/returns an instance of the class""" de...
en
0.607858
Supports iterating over a System.String object and reading its individual characters. This class cannot be inherited. hardcoded/mock instance of the class hardcoded/returns an instance of the class Clone(self: CharEnumerator) -> object Creates a copy of the current System.CharEnumerator object. Returns: ...
3.120815
3
src/home_automation_hub/config.py
levidavis/py-home
0
2195
<filename>src/home_automation_hub/config.py from .config_store import ConfigStore config = ConfigStore() config.set_mqtt_broker("mqtt", 1883) config.set_redis_config("redis", 6379, 0)
<filename>src/home_automation_hub/config.py from .config_store import ConfigStore config = ConfigStore() config.set_mqtt_broker("mqtt", 1883) config.set_redis_config("redis", 6379, 0)
none
1
1.299729
1
Harpe-website/website/contrib/communication/utils.py
Krozark/Harpe-Website
0
2196
# -*- coding: utf-8 -*- import socket as csocket from struct import pack,unpack from website.contrib.communication.models import * def enum(**enums): return type('Enum', (), enums) class Socket: Dommaine = enum(IP=csocket.AF_INET,LOCAL=csocket.AF_UNIX) Type = enum(TCP=csocket.SOCK_STREAM, UDP=csocket.SOCK...
# -*- coding: utf-8 -*- import socket as csocket from struct import pack,unpack from website.contrib.communication.models import * def enum(**enums): return type('Enum', (), enums) class Socket: Dommaine = enum(IP=csocket.AF_INET,LOCAL=csocket.AF_UNIX) Type = enum(TCP=csocket.SOCK_STREAM, UDP=csocket.SOCK...
en
0.296707
# -*- coding: utf-8 -*- #Format C Type Python type Standard size #x pad byte no value #c char string of length 1 #b signed char integer 1 #B unsigned char integer 1 #? _Bool bool 1 #h short integer ...
2.776242
3
traitarm/reconstruction/visualize_recon.py
hzi-bifo/Model-T
1
2197
import pandas as pd import ete2 from ete2 import faces, Tree, AttrFace, TreeStyle import pylab from matplotlib.colors import hex2color, rgb2hex, hsv_to_rgb, rgb_to_hsv kelly_colors_hex = [ 0xFFB300, # Vivid Yellow 0x803E75, # Strong Purple 0xFF6800, # Vivid Orange 0xA6BDD7, # Very Light Blue 0xC100...
import pandas as pd import ete2 from ete2 import faces, Tree, AttrFace, TreeStyle import pylab from matplotlib.colors import hex2color, rgb2hex, hsv_to_rgb, rgb_to_hsv kelly_colors_hex = [ 0xFFB300, # Vivid Yellow 0x803E75, # Strong Purple 0xFF6800, # Vivid Orange 0xA6BDD7, # Very Light Blue 0xC100...
en
0.613983
# Vivid Yellow # Strong Purple # Vivid Orange # Very Light Blue # Vivid Red # Grayish Yellow # Medium Gray # The following don't work well for people with defective color vision # Vivid Green # Strong Purplish Pink # Strong Blue # Strong Yellowish Pink # Strong Violet # Vivid Orange Yellow # Strong Purplish Red # Vivid...
2.441509
2
scripts/misc/operator_condition_number_scipy.py
volpatto/firedrake_scripts
5
2198
import attr from firedrake import * import numpy as np import matplotlib.pyplot as plt import matplotlib from scipy.linalg import svd from scipy.sparse.linalg import svds from scipy.sparse import csr_matrix from slepc4py import SLEPc import pandas as pd from tqdm import tqdm import os matplotlib.use('Agg') @attr.s c...
import attr from firedrake import * import numpy as np import matplotlib.pyplot as plt import matplotlib from scipy.linalg import svd from scipy.sparse.linalg import svds from scipy.sparse import csr_matrix from slepc4py import SLEPc import pandas as pd from tqdm import tqdm import os matplotlib.use('Agg') @attr.s c...
en
0.605013
Provides a plot of a matrix. # Eliminate rows and columns filled with zero entries # Plot the matrix # Remove axis ticks and values Provides a plot of a mixed matrix. # Eliminate rows and columns filled with zero entries # Plot the matrix # Remove axis ticks and values Provides a plot of a full hybrid-mixed matrix. # E...
2.320667
2
pydeap/feature_extraction/_time_domain_features.py
Wlgls/pyDEAP
0
2199
<reponame>Wlgls/pyDEAP<gh_stars>0 # -*- encoding: utf-8 -*- ''' @File :_time_domain_features.py @Time :2021/04/16 20:02:55 @Author :wlgls @Version :1.0 ''' import numpy as np def statistics(data, combined=True): """Statistical features, include Power, Mean, Std, 1st differece, Normalized 1s...
# -*- encoding: utf-8 -*- ''' @File :_time_domain_features.py @Time :2021/04/16 20:02:55 @Author :wlgls @Version :1.0 ''' import numpy as np def statistics(data, combined=True): """Statistical features, include Power, Mean, Std, 1st differece, Normalized 1st difference, 2nd difference, Nor...
en
0.801913
# -*- encoding: utf-8 -*- @File :_time_domain_features.py @Time :2021/04/16 20:02:55 @Author :wlgls @Version :1.0 Statistical features, include Power, Mean, Std, 1st differece, Normalized 1st difference, 2nd difference, Normalized 2nd difference. Parameters ---------- data array ...
3.034291
3