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
fixWL_trainData.py
jbhunter804/NBANeural
0
6623451
<reponame>jbhunter804/NBANeural<filename>fixWL_trainData.py #!/usr/bin/python import csv import random import numpy as np import pandas as pd ##inFile has meta data on where last cut off due to server issues. Will resume collecting there### inFile = "testtrainData.csv" iTrainFile = open(inFile,...
#!/usr/bin/python import csv import random import numpy as np import pandas as pd ##inFile has meta data on where last cut off due to server issues. Will resume collecting there### inFile = "testtrainData.csv" iTrainFile = open(inFile, "r") readerTrain = csv.reader(iTrainFile, delimiter=',', qu...
en
0.670433
#!/usr/bin/python ##inFile has meta data on where last cut off due to server issues. Will resume collecting there### ################################# # readerTrain[0] = headers # readerTrain[row][0] = gameid # readerTrain[row][1] = homeWin # readerTrain[row][2] = team1 score # readerTrain[row][3] = team2 score # reade...
2.878303
3
vk_bot.py
KirillYabl/quiz_bot
0
6623452
<gh_stars>0 import random import logging import os import json import dotenv import vk_api as vk from vk_api.longpoll import VkLongPoll, VkEventType from vk_api.keyboard import VkKeyboard, VkKeyboardColor import redis from common_functions import is_correct_answer, normalize_answer logger = logging.getLogger(__name_...
import random import logging import os import json import dotenv import vk_api as vk from vk_api.longpoll import VkLongPoll, VkEventType from vk_api.keyboard import VkKeyboard, VkKeyboardColor import redis from common_functions import is_correct_answer, normalize_answer logger = logging.getLogger(__name__) class V...
en
0.864452
User DB in Redis. Usage: For queries economy purpose 1. ALWAYS get user_info 2. Do other operations :param redis_db: object of connection redis db :param name_of_hash: str, name of your hash in redis # Template of info about new user # Is user got question # text of question # text...
2.540582
3
scripts/train_resnet_covidx.py
probayes/covid19xray
3
6623453
from pycovid19xray.utils import configure_logging, set_gpu configure_logging() # set_gpu(1) import torch from pycovid19xray.fastai import FastaiModel, show_metrics from pycovid19xray.tests import DATA_DIR import matplotlib.pyplot as plt from matplotlib.colors import LinearSegmentedColormap import fastai.vision as fv ...
from pycovid19xray.utils import configure_logging, set_gpu configure_logging() # set_gpu(1) import torch from pycovid19xray.fastai import FastaiModel, show_metrics from pycovid19xray.tests import DATA_DIR import matplotlib.pyplot as plt from matplotlib.colors import LinearSegmentedColormap import fastai.vision as fv ...
en
0.506395
# set_gpu(1) # show a grid ####### # model # w = torch.cuda.FloatTensor([1., 1., 6.]) # learn = fastaimodel.create_learner(data, loss_func=torch.nn.CrossEntropyLoss(weight=w)) # eval on evaluation dataset # show metrics # unfreeze and fine tune # eval on evaluation dataset
2.228893
2
configutilities/configutilities/configutilities/common/wrs_ico.py
etaivan/stx-config
0
6623454
<reponame>etaivan/stx-config<filename>configutilities/configutilities/configutilities/common/wrs_ico.py # ---------------------------------------------------------------------- # This file was generated by img2py.py # # # Copyright (c) 2015-2016 Wind River Systems, Inc. # # SPDX-License-Identifier: Apache-2.0 # # # S...
# ---------------------------------------------------------------------- # This file was generated by img2py.py # # # Copyright (c) 2015-2016 Wind River Systems, Inc. # # SPDX-License-Identifier: Apache-2.0 # # # Stylized red Wind River 'W' icon # from wx.lib.embeddedimage import PyEmbeddedImage favicon = PyEmbedde...
en
0.618888
# ---------------------------------------------------------------------- # This file was generated by img2py.py # # # Copyright (c) 2015-2016 Wind River Systems, Inc. # # SPDX-License-Identifier: Apache-2.0 # # # Stylized red Wind River 'W' icon #
1.329007
1
DI2.py
stalei/DIProject
0
6623455
<reponame>stalei/DIProject import datetime as dt import os import csv import pandas as pd import numpy as np import datetime import seaborn as sns from datetime import timedelta, date import matplotlib.pyplot as plt from sklearn.linear_model import LinearRegression from scipy.stats import chisquare def FilterDate(Data...
import datetime as dt import os import csv import pandas as pd import numpy as np import datetime import seaborn as sns from datetime import timedelta, date import matplotlib.pyplot as plt from sklearn.linear_model import LinearRegression from scipy.stats import chisquare def FilterDate(Data, DStart, DEnd): Data['...
en
0.240516
#t="+."+title #Data = Data[(Data['ShortTitle'] == t)] #t="+."+title #Data = Data[(Data['ShortTitle'] == t)] #[DataRaw['BOROUGH'] == 'MANHATTAN'].copy() #print(Data['StartDate'].year) #print(Data2) ### Use this for the rest #Data2[['HOUR']].plot.hist() #Data['StartDate']=pd.to_datetime(Data['StartDate'], format="%m/%d/%...
2.948957
3
report/report_generator.py
Raed-Mughaus/ICS-503-Assignments
0
6623456
<filename>report/report_generator.py from docx import Document from docx.shared import Inches from docx.enum.text import WD_BREAK from report.experiment_files import * from report.utils import get_descriptive_statistics import pandas as pd def _add_page_break(document): document.add_paragraph().add_run().add_brea...
<filename>report/report_generator.py from docx import Document from docx.shared import Inches from docx.enum.text import WD_BREAK from report.experiment_files import * from report.utils import get_descriptive_statistics import pandas as pd def _add_page_break(document): document.add_paragraph().add_run().add_brea...
none
1
2.538377
3
assets/containers/prowler_scan_check/app.py
aws-samples/aws-security-hub-analytic-pipeline
7
6623457
import os import boto3 from typing import List import json import sys import os import logging logger = logging.getLogger() logger.setLevel(logging.DEBUG) class ProwlerScanGroup: def __init__(self, topic_arn): self.__topic = boto3.resource('sns').Topic(topic_arn) self.__region = os.environ['AWS_R...
import os import boto3 from typing import List import json import sys import os import logging logger = logging.getLogger() logger.setLevel(logging.DEBUG) class ProwlerScanGroup: def __init__(self, topic_arn): self.__topic = boto3.resource('sns').Topic(topic_arn) self.__region = os.environ['AWS_R...
none
1
2.055715
2
flexneuart/data_convert/wikipedia_dpr/utils.py
gitter-badger/FlexNeuART
101
6623458
# # Copyright 2014+ <NAME> University # # 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 i...
# # Copyright 2014+ <NAME> University # # 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 i...
en
0.831502
# # Copyright 2014+ <NAME> University # # 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 i...
2.837778
3
setup.py
pytdlib/pytdlib
6
6623459
<reponame>pytdlib/pytdlib<filename>setup.py """The setup and build script for the pytdlib library.""" from setuptools import setup, find_packages, Command from sys import argv import shutil import os import re from generate.api import generator if len(argv) > 1 and argv[1] in ["bdist_wheel", "install"]: generato...
"""The setup and build script for the pytdlib library.""" from setuptools import setup, find_packages, Command from sys import argv import shutil import os import re from generate.api import generator if len(argv) > 1 and argv[1] in ["bdist_wheel", "install"]: generator.start() with open("README.md", "r", enco...
en
0.862013
The setup and build script for the pytdlib library.
2.115323
2
vesper/django/manage.py
RichardLitt/Vesper
29
6623460
#!/usr/bin/env python # Vesper server administration script. # # This script is a simple derivative of the standard Django manage.py script. import os import sys from vesper.archive_settings import archive_settings from vesper.archive_paths import archive_paths def main(): args = sys.argv # We ...
#!/usr/bin/env python # Vesper server administration script. # # This script is a simple derivative of the standard Django manage.py script. import os import sys from vesper.archive_settings import archive_settings from vesper.archive_paths import archive_paths def main(): args = sys.argv # We ...
en
0.815639
#!/usr/bin/env python # Vesper server administration script. # # This script is a simple derivative of the standard Django manage.py script. # We did not used to do this, but when we switched to version 3 of # the `conda-build` package the command `vesper_admin runserver` # began failing on Windows (at least, and also ...
2.199041
2
carpenter/default_settings.py
stefanw/carpenter
4
6623461
<reponame>stefanw/carpenter<gh_stars>1-10 import os DEBUG = True PROJECT_PATH = os.path.abspath(os.path.dirname(__file__)) STATIC_PATH = os.path.join(PROJECT_PATH, 'static') MEDIA_PATH = os.path.join(PROJECT_PATH, 'static', 'media') CELERY_IMPORTS = ("carpenter.tasks", )
import os DEBUG = True PROJECT_PATH = os.path.abspath(os.path.dirname(__file__)) STATIC_PATH = os.path.join(PROJECT_PATH, 'static') MEDIA_PATH = os.path.join(PROJECT_PATH, 'static', 'media') CELERY_IMPORTS = ("carpenter.tasks", )
none
1
1.730468
2
app/models/ltr559.py
mygulamali/pi-sensors
0
6623462
from pydantic import BaseModel try: from ltr559 import LTR559 as Sensor except ImportError: from mocks import LTR559 as Sensor class LTR559(BaseModel): lux: float proximity: int @classmethod def poll(cls, sensor: Sensor) -> "LTR559": sensor.update_sensor() return LTR559(lux=s...
from pydantic import BaseModel try: from ltr559 import LTR559 as Sensor except ImportError: from mocks import LTR559 as Sensor class LTR559(BaseModel): lux: float proximity: int @classmethod def poll(cls, sensor: Sensor) -> "LTR559": sensor.update_sensor() return LTR559(lux=s...
none
1
2.526833
3
app/main.py
Jonathpc/company-flaskapp
0
6623463
from app import app from flask import request, render_template, flash, redirect from app.forms import ContactForm, flash_errors import os import smtplib @app.route("/") def index(): return render_template("public/index.html") @app.route("/contact", methods=("GET", "POST")) def contact(): form = ContactFor...
from app import app from flask import request, render_template, flash, redirect from app.forms import ContactForm, flash_errors import os import smtplib @app.route("/") def index(): return render_template("public/index.html") @app.route("/contact", methods=("GET", "POST")) def contact(): form = ContactFor...
none
1
2.756924
3
code/4Class-Classification/Natural Images/Baseline_ResNet50.py
mueedhafiz1982/CNNTreeEnsemble
7
6623464
# -*- coding: utf-8 -*- """ResNet50_natimdb_v1.01.ipynb Automatically generated by Colaboratory. Original file is located at https://colab.research.google.com/drive/1q2dlcdGadeLlqI9q44EKbUzy-e57Rmls """ from google.colab import drive drive.mount('/content/drive') #code part 4 img_rows, img_cols = 224, 224 #numb...
# -*- coding: utf-8 -*- """ResNet50_natimdb_v1.01.ipynb Automatically generated by Colaboratory. Original file is located at https://colab.research.google.com/drive/1q2dlcdGadeLlqI9q44EKbUzy-e57Rmls """ from google.colab import drive drive.mount('/content/drive') #code part 4 img_rows, img_cols = 224, 224 #numb...
en
0.496829
# -*- coding: utf-8 -*- ResNet50_natimdb_v1.01.ipynb Automatically generated by Colaboratory. Original file is located at https://colab.research.google.com/drive/1q2dlcdGadeLlqI9q44EKbUzy-e57Rmls #code part 4 #number of rows and columns to convert the images to #format to store the images (rows, columns,channels)...
3.080584
3
ALGORITHM/commom/traj.py
Harold0/hmp
2
6623465
# cython: language_level=3 import numpy as np from UTILS.colorful import * from UTILS.tensor_ops import __hash__ class TRAJ_BASE(): key_data_type = {} key_data_shape = {} max_mem_length = -1 def __init__(self, traj_limit, env_id): self.traj_limit = traj_limit self.env_id = env_id ...
# cython: language_level=3 import numpy as np from UTILS.colorful import * from UTILS.tensor_ops import __hash__ class TRAJ_BASE(): key_data_type = {} key_data_shape = {} max_mem_length = -1 def __init__(self, traj_limit, env_id): self.traj_limit = traj_limit self.env_id = env_id ...
en
0.699707
# cython: language_level=3 # remember something in a time step, add it to trajectory # duplicate/rename a trajectory #return origin_handle, new_handle #return # make sure dtype is ok # create track, executed used when a key showing up for the first time in 'self.remember' # key pop up yet content is None, # read dtype ...
2.016556
2
rnacentral/portal/models/sequence_regions.py
pythseq/rnacentral-webcode
21
6623466
""" Copyright [2009-2018] EMBL-European Bioinformatics Institute 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...
""" Copyright [2009-2018] EMBL-European Bioinformatics Institute 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...
en
0.833717
Copyright [2009-2018] EMBL-European Bioinformatics Institute 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 ...
1.661153
2
Project-1/src/utils.py
TooSchoolForCool/EE219-Larger-Scale-Data-Mining
0
6623467
from sklearn.metrics import roc_curve import matplotlib.pyplot as plt import numpy as np # plot histogram based on the number of documents in each topic # in the dateset def plotHist(dataset): categories = dataset.getAllCategories() y_pos = np.arange( len(categories) ) counter = dataset.getCategorySize() ...
from sklearn.metrics import roc_curve import matplotlib.pyplot as plt import numpy as np # plot histogram based on the number of documents in each topic # in the dateset def plotHist(dataset): categories = dataset.getAllCategories() y_pos = np.arange( len(categories) ) counter = dataset.getCategorySize() ...
de
0.520979
# plot histogram based on the number of documents in each topic # in the dateset # change figure size # fig_size = fig.get_size_inches() # fig.set_size_inches(fig_size[0] * 1.5, fig_size[1], forward=True) # size figure in local directory # fig.savefig('foo.png', bbox_inches='tight') ####################################...
2.828347
3
MindLink-Eumpy/test/__init__.py
Breeze1in1drizzle/MindLink-Exploring
7
6623468
import numpy as np if __name__ == "__main__": x = np.load('EEG.npy') print(x.shape) y = np.load('EEG_1.npy') print(y.shape)
import numpy as np if __name__ == "__main__": x = np.load('EEG.npy') print(x.shape) y = np.load('EEG_1.npy') print(y.shape)
none
1
1.899042
2
Python/main.py
AsceDusk/PyJSON
0
6623469
import sys from PyQt5.QtWidgets import QApplication, QLabel, QMainWindow from PyQt5.QtCore import Qt class MainWindow(QMainWindow): def __init__(self, *args, **kwargs): super(MainWindow, self).__init__(*args, **kwargs) self.setWindowTitle("My First Python Application") label = QLabel("Th...
import sys from PyQt5.QtWidgets import QApplication, QLabel, QMainWindow from PyQt5.QtCore import Qt class MainWindow(QMainWindow): def __init__(self, *args, **kwargs): super(MainWindow, self).__init__(*args, **kwargs) self.setWindowTitle("My First Python Application") label = QLabel("Th...
en
0.74689
# IMPORTANT!!!!! Windows are hidden by default. # Start the event loop.
3.415507
3
henon_map/__init__.py
carlidel/c_henon_map
0
6623470
import matplotlib.pyplot as plt from numba import cuda, jit, njit, prange import numpy as np from tqdm import tqdm import pickle import time from . import gpu_henon_core as gpu from . import cpu_henon_core as cpu from .cpu_henon_core import recursive_accumulation as cpu_accumulate_and_return def polar_to...
import matplotlib.pyplot as plt from numba import cuda, jit, njit, prange import numpy as np from tqdm import tqdm import pickle import time from . import gpu_henon_core as gpu from . import cpu_henon_core as cpu from .cpu_henon_core import recursive_accumulation as cpu_accumulate_and_return def polar_to...
en
0.655203
Generates a modulation Parameters ---------- epsilon : float intensity of modulation n_elements : float number of elements first_index : int, optional starting point of the modulation, by default 0 Returns ------- tuple of ndarray (...
2.285385
2
_doc/sphinxdoc/source/conf.py
sdpython/manyapi
1
6623471
<gh_stars>1-10 # -*- coding: utf-8 -*- import sys import os import alabaster from pyquickhelper.helpgen.default_conf import set_sphinx_variables sys.path.insert(0, os.path.abspath(os.path.join(os.path.split(__file__)[0]))) set_sphinx_variables(__file__, "manydataapi", "<NAME>", 2021, "alabaster",...
# -*- coding: utf-8 -*- import sys import os import alabaster from pyquickhelper.helpgen.default_conf import set_sphinx_variables sys.path.insert(0, os.path.abspath(os.path.join(os.path.split(__file__)[0]))) set_sphinx_variables(__file__, "manydataapi", "<NAME>", 2021, "alabaster", alabaster.get_...
en
0.769321
# -*- coding: utf-8 -*-
1.482055
1
Chapter05/nlp47.py
gushwell/PythonNLP100
2
6623472
import re import functools class Morph: def __init__(self, surface, base, pos, pos1): self.surface = surface self.base = base self.pos = pos self.pos1 = pos1 def toList(self): return [self.surface, self.base, self.pos, self.pos1] class Chunk: def __init__(self, num...
import re import functools class Morph: def __init__(self, surface, base, pos, pos1): self.surface = surface self.base = base self.pos = pos self.pos1 = pos1 def toList(self): return [self.surface, self.base, self.pos, self.pos1] class Chunk: def __init__(self, num...
none
1
2.948699
3
Python/OneLang/One/Transforms/InferTypesPlugins/NullabilityCheckWithNot.py
onelang/OneLang-CrossCompiled
2
6623473
from onelang_core import * import OneLang.One.Transforms.InferTypesPlugins.Helpers.InferTypesPlugin as inferTypesPlug import OneLang.One.Ast.Expressions as exprs import OneLang.One.Ast.AstTypes as astTypes class NullabilityCheckWithNot(inferTypesPlug.InferTypesPlugin): def __init__(self): super().__init__(...
from onelang_core import * import OneLang.One.Transforms.InferTypesPlugins.Helpers.InferTypesPlugin as inferTypesPlug import OneLang.One.Ast.Expressions as exprs import OneLang.One.Ast.AstTypes as astTypes class NullabilityCheckWithNot(inferTypesPlug.InferTypesPlugin): def __init__(self): super().__init__(...
none
1
2.17112
2
android/app/src/main/python/electroncash_plugins/__init__.py
proteanx/DeLight
16
6623474
<filename>android/app/src/main/python/electroncash_plugins/__init__.py # Plugins are not used in the Android app, but various code still expects this package to # exist.
<filename>android/app/src/main/python/electroncash_plugins/__init__.py # Plugins are not used in the Android app, but various code still expects this package to # exist.
en
0.933994
# Plugins are not used in the Android app, but various code still expects this package to # exist.
1.284544
1
fedlab/core/client/scale/trainer.py
SMILELab-FL/FedLab
171
6623475
# Copyright 2021 Peng Cheng Laboratory (http://www.szpclab.com/) and FedLab Authors (smilelab.group) # 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/LICEN...
# Copyright 2021 Peng Cheng Laboratory (http://www.szpclab.com/) and FedLab Authors (smilelab.group) # 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/LICEN...
en
0.722833
# Copyright 2021 Peng Cheng Laboratory (http://www.szpclab.com/) and FedLab Authors (smilelab.group) # 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.044127
2
numerics/solver.py
gdikov/MNIST_Challenge
1
6623476
<filename>numerics/solver.py import numpy as np class Solver(object): def __init__(self): pass def update(self, x, dx): pass class SGD(Solver): def __init__(self, config=None): super(SGD, self).__init__() if config is None: config = dict() config['...
<filename>numerics/solver.py import numpy as np class Solver(object): def __init__(self): pass def update(self, x, dx): pass class SGD(Solver): def __init__(self, config=None): super(SGD, self).__init__() if config is None: config = dict() config['...
none
1
3.038327
3
src/pdes/wave.py
gelijergensen/Constrained-Neural-Nets-Workbook
3
6623477
<reponame>gelijergensen/Constrained-Neural-Nets-Workbook """Implementation of the wave PDE""" import numpy as np import torch from src.derivatives import jacobian, jacobian_and_laplacian __all__ = ["helmholtz_equation", "pythagorean_equation"] def helmholtz_equation( outputs, inputs, parameterization, return_d...
"""Implementation of the wave PDE""" import numpy as np import torch from src.derivatives import jacobian, jacobian_and_laplacian __all__ = ["helmholtz_equation", "pythagorean_equation"] def helmholtz_equation( outputs, inputs, parameterization, return_diagnostics=False ): """Computes the Helmholtz equatio...
en
0.676683
Implementation of the wave PDE Computes the Helmholtz equation (time independent wave equation) value, given the model inputs, outputs, and paramerization of the wave :param outputs: output of some network :param inputs: inputs to some network :param parameterization: parameterization of the PDE w...
3.409109
3
tests/data/annotation_types/classification/test_classification.py
nickaustinlee/labelbox-python
0
6623478
import pytest from pydantic import ValidationError from labelbox.data.annotation_types import (Checklist, ClassificationAnswer, Dropdown, Radio, Text, ClassificationAnnotation) def test_classification_answer(): with pytest.ra...
import pytest from pydantic import ValidationError from labelbox.data.annotation_types import (Checklist, ClassificationAnswer, Dropdown, Radio, Text, ClassificationAnnotation) def test_classification_answer(): with pytest.ra...
en
0.836949
# Should have feature schema info
2.640284
3
encoder_ui/app.py
hidnoiz/encoder_ui
0
6623479
<reponame>hidnoiz/encoder_ui from flask import Flask from werkzeug.debug import DebuggedApplication from celery import Celery from encoder_ui.api import blueprint_api from encoder_ui.web import blueprint_web CELERY_TASK_LIST = [ 'encoder_ui.celery.discovery.tasks' ] def create_celery_app(app=None): app = app...
from flask import Flask from werkzeug.debug import DebuggedApplication from celery import Celery from encoder_ui.api import blueprint_api from encoder_ui.web import blueprint_web CELERY_TASK_LIST = [ 'encoder_ui.celery.discovery.tasks' ] def create_celery_app(app=None): app = app or create_app() celery ...
en
0.583428
Create a Flask application using the app factory pattern. :param settings_override: Override settings :return: Flask app
2.232972
2
dev/torch/nn/functional/linear.py
Jintao-Huang/torch_study
4
6623480
<reponame>Jintao-Huang/torch_study<filename>dev/torch/nn/functional/linear.py # Author: <NAME> # Email: <EMAIL> # Date: import torch from torch import Tensor """ - 矩阵乘时间复杂度: e.g. [A, B] @ [B, C]. Ot(ABC) - linear时间复杂度: Ot(N*In*Out) """ def linear(input: Tensor, weight: Tensor, bias: Tensor = None) -> Tensor: ""...
# Author: <NAME> # Email: <EMAIL> # Date: import torch from torch import Tensor """ - 矩阵乘时间复杂度: e.g. [A, B] @ [B, C]. Ot(ABC) - linear时间复杂度: Ot(N*In*Out) """ def linear(input: Tensor, weight: Tensor, bias: Tensor = None) -> Tensor: """ :param input: shape[N, In] :param weight: shape[Out, In] :param...
en
0.440463
# Author: <NAME> # Email: <EMAIL> # Date: - 矩阵乘时间复杂度: e.g. [A, B] @ [B, C]. Ot(ABC) - linear时间复杂度: Ot(N*In*Out) :param input: shape[N, In] :param weight: shape[Out, In] :param bias: shape[Out] :return: shape[N, Out] # # Ot(N*In*Out) # Ot(N*Out)
2.972944
3
wine_informatics/knn_algorithm/knn_algorithm.py
Williano/Data-Mining
0
6623481
import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split, cross_val_score, \ GridSearchCV from sklearn.neighbors import KNeighborsClassifier from sklearn.metrics import classification_report, confusion_matrix, \ ...
import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split, cross_val_score, \ GridSearchCV from sklearn.neighbors import KNeighborsClassifier from sklearn.metrics import classification_report, confusion_matrix, \ ...
en
0.352801
# dataset = shuffled_data.iloc[:, : 485].values # dataset = shuffled_data.iloc[:, : 482].values # error = [] # # Calculating error for K values between 1 and 40 # for i in range(1, 100): # knn = KNeighborsClassifier(n_neighbors=i) # knn.fit(X_train, y_train) # pred_i = knn.predict(X_test) # error.append...
3.118694
3
match.py
mbardoeChoate/FRC-Monkey-Poll
0
6623482
<filename>match.py import random from math import exp import constants class Match(object): def __init__(self, A_teams, B_teams, score): self.A_teams=A_teams # a list of A teams self.B_teams=B_teams # a list of B teams self.score=score # the score with A teams first and B teams second ...
<filename>match.py import random from math import exp import constants class Match(object): def __init__(self, A_teams, B_teams, score): self.A_teams=A_teams # a list of A teams self.B_teams=B_teams # a list of B teams self.score=score # the score with A teams first and B teams second ...
en
0.923385
# a list of A teams # a list of B teams # the score with A teams first and B teams second # Choose the team to go with
3.215963
3
src/lib/email/__init__.py
timmartin/skulpt
10
6623483
raise NotImplementedError("email is not yet implemented in Skulpt")
raise NotImplementedError("email is not yet implemented in Skulpt")
none
1
1.158674
1
tests/cameraUp.py
mshafiei/cvutils
2
6623484
#This script renders input data for Deep Reflectance Volume import cvgutils.Mitsuba2XML as mts import cvgutils.Image as im import cvgutils.Linalg as lin import cvgutils.Dir as dr import cvgutils.Utils as util import cv2 import numpy as np import torch import os from scipy.interpolate import interp1d def randomPathSph...
#This script renders input data for Deep Reflectance Volume import cvgutils.Mitsuba2XML as mts import cvgutils.Image as im import cvgutils.Linalg as lin import cvgutils.Dir as dr import cvgutils.Utils as util import cv2 import numpy as np import torch import os from scipy.interpolate import interp1d def randomPathSph...
en
0.607781
#This script renders input data for Deep Reflectance Volume [Given parameers of a 1d path returns phi, theta on that path] Args: x ([ndarray]): [path parameters] Returns: [tuple]: [points on the path on a sphere] [Given parameers of a 1d path returns phi, theta on that path] ...
2.31959
2
utils/formatters.py
bijij/yert
0
6623485
""" MIT License Copyright (c) 2020 - µYert Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distr...
""" MIT License Copyright (c) 2020 - µYert Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distr...
en
0.738834
MIT License Copyright (c) 2020 - µYert Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribut...
2.047321
2
imager.py
johnnyc2/FOS_View
2
6623486
<reponame>johnnyc2/FOS_View<gh_stars>1-10 #!/usr/bin/env python import argparse from fosfile import Vault from PIL import Image, ImageDraw def getCoordinates(col, row, width, config): x1 = col * (config['roomWidth'] + config['roomSpaceX']) + config['roomOffsetX'] x2 = x1 + width * (config['roomWidth'] + confi...
#!/usr/bin/env python import argparse from fosfile import Vault from PIL import Image, ImageDraw def getCoordinates(col, row, width, config): x1 = col * (config['roomWidth'] + config['roomSpaceX']) + config['roomOffsetX'] x2 = x1 + width * (config['roomWidth'] + config['roomSpaceX']) - config['roomSpaceX'] ...
ru
0.26433
#!/usr/bin/env python
3.046979
3
Problems/Binary_Tree/vertical_sum.py
MayaScarlet/python-dsa
0
6623487
<filename>Problems/Binary_Tree/vertical_sum.py<gh_stars>0 """ Given a binary tree, the print vertical sum of it. Assume the left and right child of a node makes a 45–degree angle with the parent. """ class TreeNode: def __init__(self, val=0, left=None, right=None): self.val = val self.left = left ...
<filename>Problems/Binary_Tree/vertical_sum.py<gh_stars>0 """ Given a binary tree, the print vertical sum of it. Assume the left and right child of a node makes a 45–degree angle with the parent. """ class TreeNode: def __init__(self, val=0, left=None, right=None): self.val = val self.left = left ...
en
0.861352
Given a binary tree, the print vertical sum of it. Assume the left and right child of a node makes a 45–degree angle with the parent.
3.950415
4
community_profiles/datasets/septa.py
nickhand/community-profiles
0
6623488
import esri2gpd import geopandas as gpd from . import EPSG from .core import Dataset, geocode from .regions import * __all__ = ["RegionalRail", "SubwayBroadSt", "SubwayMFL", "Bus"] class RegionalRail(Dataset): """ Spring 2018 Regional Rail Rail Lines with Ridership. Route ridership and revenue informatio...
import esri2gpd import geopandas as gpd from . import EPSG from .core import Dataset, geocode from .regions import * __all__ = ["RegionalRail", "SubwayBroadSt", "SubwayMFL", "Bus"] class RegionalRail(Dataset): """ Spring 2018 Regional Rail Rail Lines with Ridership. Route ridership and revenue informatio...
en
0.816748
Spring 2018 Regional Rail Rail Lines with Ridership. Route ridership and revenue information is from FY2017. Data is from SEPTA's Revenue & Ridership Department. Source ------ http://septaopendata-septa.opendata.arcgis.com/datasets/septa-regional-rail-lines Spring 2018 Broad Street Line with Riders...
2.64485
3
yann/utils/tensor.py
michalwols/yann
32
6623489
import torch def weighted_sum(tensors, weights): if len(tensors) < 2: raise ValueError('must pass at least 2 tensors') s = tensors[0] * weights[0] for t, w in zip(tensors[1:], weights[1:]): s.add_(w, t) return s def one_hot(targets: torch.Tensor, num_classes=None, device=None, dtype=None, normalize=F...
import torch def weighted_sum(tensors, weights): if len(tensors) < 2: raise ValueError('must pass at least 2 tensors') s = tensors[0] * weights[0] for t, w in zip(tensors[1:], weights[1:]): s.add_(w, t) return s def one_hot(targets: torch.Tensor, num_classes=None, device=None, dtype=None, normalize=F...
none
1
2.664646
3
sandy-disaster-recovery/aws.py
toddjcrane/crisiscleanup-legacy
1
6623490
<gh_stars>1-10 """ Amazon Web Services API Rationale: the standard boto library throws errors on GAE, seemingly due to google.appengine.api.urlfetch """ import logging from time import mktime import datetime from wsgiref.handlers import format_date_time import hmac import hashlib import base64 from xml.etree import ...
""" Amazon Web Services API Rationale: the standard boto library throws errors on GAE, seemingly due to google.appengine.api.urlfetch """ import logging from time import mktime import datetime from wsgiref.handlers import format_date_time import hmac import hashlib import base64 from xml.etree import ElementTree fro...
en
0.71757
Amazon Web Services API Rationale: the standard boto library throws errors on GAE, seemingly due to google.appengine.api.urlfetch # construct multipart email # post to AWS SES
2.360312
2
test/test_setup.py
ccarouge/payu
5
6623491
<reponame>ccarouge/payu<gh_stars>1-10 import copy import os from pathlib import Path import pdb import pytest import shutil import yaml import payu import payu.models.test from .common import cd, make_random_file, get_manifests from .common import tmpdir, ctrldir, labdir, workdir from .common import sweep_work, payu_...
import copy import os from pathlib import Path import pdb import pytest import shutil import yaml import payu import payu.models.test from .common import cd, make_random_file, get_manifests from .common import tmpdir, ctrldir, labdir, workdir from .common import sweep_work, payu_init, payu_setup from .common import c...
en
0.902579
Create files required for test model Put any test-wide setup code in here, e.g. creating test files # Should be taken care of by teardown, in case remnants lying around Put any test-wide teardown code in here, e.g. removing test outputs # shutil.rmtree(tmpdir) # These are integration tests. They have an undesirable dep...
2.308729
2
user/serializers.py
MrNewaz/Coding-Assignment
0
6623492
from rest_framework import serializers from .models import * # Parent Serializer (for the Parent model) class ParentSerializer(serializers.ModelSerializer): class Meta: model = Parent fields = '__all__' # Child Serializer (for the Child model) class ChildSerializer(serializers.ModelSerializer)...
from rest_framework import serializers from .models import * # Parent Serializer (for the Parent model) class ParentSerializer(serializers.ModelSerializer): class Meta: model = Parent fields = '__all__' # Child Serializer (for the Child model) class ChildSerializer(serializers.ModelSerializer)...
en
0.716032
# Parent Serializer (for the Parent model) # Child Serializer (for the Child model)
2.168593
2
verify/checker/abc218/b.py
naskya/testcase-generator
4
6623493
<gh_stars>1-10 def main() -> None: P = list(map(int, input().split())) P.sort() assert len(P) == 26 assert P == list(range(1, 26 + 1)) if __name__ == '__main__': main()
def main() -> None: P = list(map(int, input().split())) P.sort() assert len(P) == 26 assert P == list(range(1, 26 + 1)) if __name__ == '__main__': main()
none
1
2.65079
3
api-dev/venv/lib/python3.6/site-packages/web3/_utils/personal.py
twaddle-dev/CoVid-19
0
6623494
from typing import ( Any, Callable, Dict, List, Optional, ) from eth_typing import ( ChecksumAddress, HexStr, ) from hexbytes import ( HexBytes, ) from web3._utils.compat import ( Protocol, ) from web3._utils.rpc_abi import ( RPC, ) from web3.method import ( Method, def...
from typing import ( Any, Callable, Dict, List, Optional, ) from eth_typing import ( ChecksumAddress, HexStr, ) from hexbytes import ( HexBytes, ) from web3._utils.compat import ( Protocol, ) from web3._utils.rpc_abi import ( RPC, ) from web3.method import ( Method, def...
none
1
1.871402
2
postpost/api/filters.py
PiterPy-Meetup/postpost
6
6623495
from django_filters import rest_framework as filters from api import models class PublicationFilterSet(filters.FilterSet): """ Uses for filtering in publication-list endpoint by query-string. """ # scheduled=false is equivalent to scheduled_at__isnull=True scheduled = filters.BooleanFilter( ...
from django_filters import rest_framework as filters from api import models class PublicationFilterSet(filters.FilterSet): """ Uses for filtering in publication-list endpoint by query-string. """ # scheduled=false is equivalent to scheduled_at__isnull=True scheduled = filters.BooleanFilter( ...
en
0.762258
Uses for filtering in publication-list endpoint by query-string. # scheduled=false is equivalent to scheduled_at__isnull=True # If you want change this filtering, first read comment # for PlatformPost.PLATFORM_TYPES
2.264413
2
netpyntest_lib/api.py
aespinosaalvarez/NetPyntest
1
6623496
# -*- coding: utf-8 -*- """ This file contains API calls and Data """ import six from sys import path from termcolor import colored from os import geteuid from os import path from .data import * __version__ = "1.0.0" __all__ = ["run_console", "run", "GlobalParameters"] # -----------------------------------------...
# -*- coding: utf-8 -*- """ This file contains API calls and Data """ import six from sys import path from termcolor import colored from os import geteuid from os import path from .data import * __version__ = "1.0.0" __all__ = ["run_console", "run", "GlobalParameters"] # -----------------------------------------...
en
0.24038
# -*- coding: utf-8 -*- This file contains API calls and Data # -------------------------------------------------------------------------- # # Command line options # # -------------------------------------------------------------------------- :param config: GlobalParameters option instance :type config: `GlobalPara...
2.561464
3
popularshots/conf/settings.py
gustavohenrique/dribbble-popular-shots
1
6623497
import os BASE_DIR = os.path.dirname(os.path.dirname(__file__)) SECRET_KEY = '<KEY>' DEBUG = True TEMPLATE_DEBUG = True ALLOWED_HOSTS = ['*'] INSTALLED_APPS = ( 'admin_bootstrap', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'djan...
import os BASE_DIR = os.path.dirname(os.path.dirname(__file__)) SECRET_KEY = '<KEY>' DEBUG = True TEMPLATE_DEBUG = True ALLOWED_HOSTS = ['*'] INSTALLED_APPS = ( 'admin_bootstrap', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'djan...
en
0.112173
# 'django.middleware.csrf.CsrfViewMiddleware', #'TEST_NAME': os.path.join(os.path.dirname(__file__), 'test.db'),
1.646654
2
trains/models.py
llamicron/old_trains
0
6623498
<reponame>llamicron/old_trains """ Stores database models """ import os import sys from peewee import * try: from trains.db import db except ImportError: from db import db class Volunteer(Model): bsa_id = CharField() first_name = CharField() last_name = CharField() email = CharField() di...
""" Stores database models """ import os import sys from peewee import * try: from trains.db import db except ImportError: from db import db class Volunteer(Model): bsa_id = CharField() first_name = CharField() last_name = CharField() email = CharField() district = CharField() counci...
en
0.867341
Stores database models Pulls data from CSV source file and writes Volunteer models to db # Dictionary of volunteer data # Read from csv like on Volunteer # Read from csv like on Volunteer # Training.populate() # Role.populate()
3.17448
3
adi_study_watch/jenkins/zip_gen.py
ArrowElectronics/Vital-Signs-Monitoring
5
6623499
<reponame>ArrowElectronics/Vital-Signs-Monitoring<filename>adi_study_watch/jenkins/zip_gen.py import os import shutil import time import comtypes.client #from docx2pdf import convert src_path = os.path.abspath(os.path.join(__file__, '../../')) dest_path = r'zip_gen_tmp/adi_study_watch' excludes_file_path = os.path.joi...
import os import shutil import time import comtypes.client #from docx2pdf import convert src_path = os.path.abspath(os.path.join(__file__, '../../')) dest_path = r'zip_gen_tmp/adi_study_watch' excludes_file_path = os.path.join(src_path, 'jenkins', 'zip_gen_excludes.txt') def copy_repo_package(): shutil.copytree(...
en
0.286936
#from docx2pdf import convert #convert(doc_file_path) <file file_name="../../../utilities/tracealyser/trace_recorder/streamports/Jlink_RTT/SEGGER_RTT_tracealyser.c"> <configuration Name="Debug" build_exclude_from_build="Yes" /> <configuration Name="Release" build_exclude_from_build="Yes" /> ...
2.559565
3
setup.py
xando/django-modelhistory
1
6623500
# -*- coding: utf-8 -*- from setuptools import setup, find_packages from modelhistory import VERSION long_description = """Simple model logging helper for django projects. Covers functionality of discovering action taken on object: DELETE, UPDATE, CREATE and creates and saves suitable message to database. Supports si...
# -*- coding: utf-8 -*- from setuptools import setup, find_packages from modelhistory import VERSION long_description = """Simple model logging helper for django projects. Covers functionality of discovering action taken on object: DELETE, UPDATE, CREATE and creates and saves suitable message to database. Supports si...
en
0.855606
# -*- coding: utf-8 -*- Simple model logging helper for django projects. Covers functionality of discovering action taken on object: DELETE, UPDATE, CREATE and creates and saves suitable message to database. Supports simple db.models.Models objects as well as forms, formset and inlineformset based on Django ORM Models.
1.852275
2
amalia/archetypes/TimeSeriesArchetype.py
Aganonce/AMALIA-lite
0
6623501
import logging logger = logging.getLogger(__name__.split('.')[-1]) import sys import itertools import numpy as np import pandas as pd import scipy.sparse as ss import tools.Cache as Cache class TimeSeriesArchetype: ''' Time series archetype generates a sparse matrix representation of user time series w...
import logging logger = logging.getLogger(__name__.split('.')[-1]) import sys import itertools import numpy as np import pandas as pd import scipy.sparse as ss import tools.Cache as Cache class TimeSeriesArchetype: ''' Time series archetype generates a sparse matrix representation of user time series w...
en
0.847996
Time series archetype generates a sparse matrix representation of user time series within primary dataframes. Each time series is created by binning activity within some time delta. Parameters ---------- time_delta : int (default : 86400) The time range (in seconds) to bin activity togethe...
2.641551
3
application/product/models.py
riihikallio/tsoha
0
6623502
from application import db from application.models import Base class Product(Base): number = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(144), nullable=False) unit = db.Column(db.String(10), nullable=False) price = db.Column(db.Float(), nullable=False) category = db.Column(d...
from application import db from application.models import Base class Product(Base): number = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(144), nullable=False) unit = db.Column(db.String(10), nullable=False) price = db.Column(db.Float(), nullable=False) category = db.Column(d...
none
1
2.731282
3
active_learning_lab/data/embeddings.py
webis-de/acl22-revisiting-uncertainty-based-query-strategies-for-active-learning-with-transformers
0
6623503
<filename>active_learning_lab/data/embeddings.py import torch import numpy as np from pathlib import Path def get_embedding_matrix(name, vocab, data_dir='.data/'): from gensim.models.word2vec import Word2VecKeyedVectors embedding_dir = Path(data_dir).joinpath('embeddings') embedding_dir.mkdir(parents=Tr...
<filename>active_learning_lab/data/embeddings.py import torch import numpy as np from pathlib import Path def get_embedding_matrix(name, vocab, data_dir='.data/'): from gensim.models.word2vec import Word2VecKeyedVectors embedding_dir = Path(data_dir).joinpath('embeddings') embedding_dir.mkdir(parents=Tr...
none
1
2.593697
3
models/worker.py
xuanthuong/golfgame
0
6623504
# -*- coding: utf-8 -*- # Description: worker_tb table # By Thuong.Tran # Date: 29 Aug 2017 from sqlalchemy import create_engine, Table, Column, MetaData, Integer, Text, DateTime, Float from sqlalchemy import select class worker(): def __init__(self, db_url): _engine = create_engine(db_url) _connection = _...
# -*- coding: utf-8 -*- # Description: worker_tb table # By Thuong.Tran # Date: 29 Aug 2017 from sqlalchemy import create_engine, Table, Column, MetaData, Integer, Text, DateTime, Float from sqlalchemy import select class worker(): def __init__(self, db_url): _engine = create_engine(db_url) _connection = _...
en
0.591127
# -*- coding: utf-8 -*- # Description: worker_tb table # By Thuong.Tran # Date: 29 Aug 2017
2.923253
3
PyNN/brunel_test.py
OpenSourceBrain/Brunel2000
4
6623505
<reponame>OpenSourceBrain/Brunel2000<gh_stars>1-10 """ A scaled down version of the Brunel model useful for testing (see OMV files: .test.*) """ from brunel08 import runBrunelNetwork from pyNN.utility import get_script_args simulator_name = get_script_args(1)[0] simtime = 1000 order = 100 eta = 2.0 # r...
""" A scaled down version of the Brunel model useful for testing (see OMV files: .test.*) """ from brunel08 import runBrunelNetwork from pyNN.utility import get_script_args simulator_name = get_script_args(1)[0] simtime = 1000 order = 100 eta = 2.0 # rel rate of external input g = 5.0 runBru...
en
0.665112
A scaled down version of the Brunel model useful for testing (see OMV files: .test.*) # rel rate of external input
1.886121
2
compose/apps.py
iafisher/writingstreak
2
6623506
from django.apps import AppConfig class ComposeConfig(AppConfig): name = 'compose'
from django.apps import AppConfig class ComposeConfig(AppConfig): name = 'compose'
none
1
1.202895
1
respet/recon/reconstruction.py
jjleewustledu/NiftyPETy
0
6623507
import numpy as np import os import logging, sys # create and configure main logger; # see also https://stackoverflow.com/questions/50714316/how-to-use-logging-getlogger-name-in-multiple-modules/50715155#50715155 logging.basicConfig(stream=sys.stderr, level=logging.INFO) class Reconstruction(object): __author__ ...
import numpy as np import os import logging, sys # create and configure main logger; # see also https://stackoverflow.com/questions/50714316/how-to-use-logging-getlogger-name-in-multiple-modules/50715155#50715155 logging.basicConfig(stream=sys.stderr, level=logging.INFO) class Reconstruction(object): __author__ ...
en
0.539339
# create and configure main logger; # see also https://stackoverflow.com/questions/50714316/how-to-use-logging-getlogger-name-in-multiple-modules/50715155#50715155 # see also: mmrrec.py osemone param mask_radious # sinogram index (<127 for direct sinograms) # selects from ~/.niftypet/resources.py: hrdwr_mu :return e...
2.278536
2
setup.py
manish-sin/BeterRoads
0
6623508
import os import shutil # Here we will do some initial setup # We will remove all the folders and some cvs files which needs to be empty when starting a fresh project # Currently the folders populated with data for reference # commands below will remove these folders and create a new one with same name #Here we defin...
import os import shutil # Here we will do some initial setup # We will remove all the folders and some cvs files which needs to be empty when starting a fresh project # Currently the folders populated with data for reference # commands below will remove these folders and create a new one with same name #Here we defin...
en
0.902643
# Here we will do some initial setup # We will remove all the folders and some cvs files which needs to be empty when starting a fresh project # Currently the folders populated with data for reference # commands below will remove these folders and create a new one with same name #Here we define the path of all such fol...
2.664221
3
azqa/main.py
basilbc2000/bas-python-projects
0
6623509
<filename>azqa/main.py import genconmaps as pcr import gendistmatrices as gdm import genplots as gnp import genmodels as gnm import genfiles as gnf # import gendag as gnd ''' read pcaps get connections/conversations refine data as needed get distances (dtw, ngram) generate model generate heatma...
<filename>azqa/main.py import genconmaps as pcr import gendistmatrices as gdm import genplots as gnp import genmodels as gnm import genfiles as gnf # import gendag as gnd ''' read pcaps get connections/conversations refine data as needed get distances (dtw, ngram) generate model generate heatma...
en
0.514408
# import gendag as gnd read pcaps get connections/conversations refine data as needed get distances (dtw, ngram) generate model generate heatmap analyze results # samples = pcr.getRandomConversations(conversations, 10) # ('172.16.17.32', '172.16.31.10') # delta, ip.len, sport, dport, ip.p, times...
1.982855
2
django/kisaan/dashboard/urls.py
AkshitOstwal/cfthacks2019
2
6623510
from django.urls import path from . import views from django.contrib.auth.decorators import login_required app_name = 'dashboard' urlpatterns = [ path('',login_required(views.IndexView.as_view()),name='index'), ]
from django.urls import path from . import views from django.contrib.auth.decorators import login_required app_name = 'dashboard' urlpatterns = [ path('',login_required(views.IndexView.as_view()),name='index'), ]
none
1
1.631737
2
android/jni/msbuild.py
aselle/flatbuffers
4,526
6623511
#!/usr/bin/python # Copyright 2014 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 a...
#!/usr/bin/python # Copyright 2014 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 a...
en
0.815969
#!/usr/bin/python # Copyright 2014 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 a...
2.791233
3
aqua_test/cli.py
behara/AquaRepo
25
6623512
from . import __version__ import click from .core import initializer INTERACTIVE_INIT_HELP = 'Start an interactive session to compose config file' @click.version_option(__version__, message='%(version)s') @click.group() def main(): ''' Boss CLI. ''' pass @main.command('init') @click.option('--interactive'...
from . import __version__ import click from .core import initializer INTERACTIVE_INIT_HELP = 'Start an interactive session to compose config file' @click.version_option(__version__, message='%(version)s') @click.group() def main(): ''' Boss CLI. ''' pass @main.command('init') @click.option('--interactive'...
en
0.671493
Boss CLI. Initialize a project directory for boss. # Print the files generated while initializing.
2.653244
3
misc/add_path_to_envpath.py
mkroman/platformio-atom-ide
1
6623513
<gh_stars>1-10 # Copyright (c) 2016-present, PlatformIO Plus <<EMAIL>> # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. """Add paths to Windows %PATH% environment variable.""" import os import sys import ctypes from ctypes...
# Copyright (c) 2016-present, PlatformIO Plus <<EMAIL>> # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. """Add paths to Windows %PATH% environment variable.""" import os import sys import ctypes from ctypes.wintypes impor...
en
0.853287
# Copyright (c) 2016-present, PlatformIO Plus <<EMAIL>> # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. Add paths to Windows %PATH% environment variable. # PY2 # notify the system about the changes
2.116113
2
cellsium/model/__init__.py
modsim/CellSium
0
6623514
<reponame>modsim/CellSium<gh_stars>0 """Cell model package.""" from typing import Any, Iterable, Mapping, Optional from ..parameters import h_to_s, s_to_h from ..simulation.simulator import Timestep from .agent import ( Copyable, IdCounter, InitializeWithParameters, Representable, WithLineage, ...
"""Cell model package.""" from typing import Any, Iterable, Mapping, Optional from ..parameters import h_to_s, s_to_h from ..simulation.simulator import Timestep from .agent import ( Copyable, IdCounter, InitializeWithParameters, Representable, WithLineage, WithLineageHistory, WithRandomSeq...
en
0.758035
Cell model package. Generates a cell class using the standard classes, and possible additional classes. :param additional_classes: Additional classes to inherit the cell from. :param name: Name of the class :return: Class Assembles a cell class from parent classes. Necessary as the cell class needs the...
2.732858
3
domain/entities/errors/InvalidMonth.py
JVGC/MyFinancesPython
0
6623515
<gh_stars>0 class InvalidMonth: def __init__(self, avaiable_months) -> None: self.message = 'Invalid Month' self.entity = 'Month' self.reason = f"Month should be in: {avaiable_months}"
class InvalidMonth: def __init__(self, avaiable_months) -> None: self.message = 'Invalid Month' self.entity = 'Month' self.reason = f"Month should be in: {avaiable_months}"
none
1
2.871544
3
siebenapp/tests/test_system.py
ahitrin/SiebenApp
14
6623516
# coding: utf-8 import pytest from approvaltests import verify # type: ignore from siebenapp.system import split_long, dot_export from siebenapp.tests.dsl import build_goaltree, open_, clos_, selected, previous @pytest.mark.parametrize( "source,result", [ ("short", "short"), ("10: Example mu...
# coding: utf-8 import pytest from approvaltests import verify # type: ignore from siebenapp.system import split_long, dot_export from siebenapp.tests.dsl import build_goaltree, open_, clos_, selected, previous @pytest.mark.parametrize( "source,result", [ ("short", "short"), ("10: Example mu...
en
0.338409
# coding: utf-8 # type: ignore #$%^&*()\\/,.?"),
2.072121
2
ibslib/io/__init__.py
songsiwei/Ogre_r_sv
0
6623517
<filename>ibslib/io/__init__.py __author__ = '<NAME>' from .read import * from .write import * from .aims_extractor import AimsExtractor from .check import *
<filename>ibslib/io/__init__.py __author__ = '<NAME>' from .read import * from .write import * from .aims_extractor import AimsExtractor from .check import *
none
1
1.10722
1
vulnerability_mapping/hot_spot_mapping.py
worldbank/CityScan
4
6623518
import sys, os, importlib, math, shutil import rasterio import skimage import numpy as np import pandas as pd import geopandas as gpd import osmnx as ox import GOSTnets as gn import skimage.graph as graph from rasterio.mask import mask from rasterio import features from rasterio.warp import reproject, Resampling from...
import sys, os, importlib, math, shutil import rasterio import skimage import numpy as np import pandas as pd import geopandas as gpd import osmnx as ox import GOSTnets as gn import skimage.graph as graph from rasterio.mask import mask from rasterio import features from rasterio.warp import reproject, Resampling from...
en
0.805614
# Driving Speed for attributing road networks with speed # kmph Get speed from the above speed dict, but some of the suppied x's are actually lists INPUT x [string] - infra type to look up in s_dict s_dict [dictionary] - see speed_dict above RETURNS [number] speed Extract nodes from OSM ...
2.36387
2
Exercise-3/03.py
abhay-lal/18CSC207J-APP
0
6623519
class Dept: def _init_(self, student_name='SCO'): self.student_name = student_name st1 = Dept() st2 = Dept('John') print(st1.student_name) print(st2.student_name)
class Dept: def _init_(self, student_name='SCO'): self.student_name = student_name st1 = Dept() st2 = Dept('John') print(st1.student_name) print(st2.student_name)
none
1
3.537302
4
scripts/delete_all.py
noppanit/airfare-recommendation
1
6623520
<reponame>noppanit/airfare-recommendation import sys import os.path parent = os.path.abspath(os.path.join(os.path.dirname(__file__),'..')) sys.path.append(parent) from airfare.atc import delete_all delete_all()
import sys import os.path parent = os.path.abspath(os.path.join(os.path.dirname(__file__),'..')) sys.path.append(parent) from airfare.atc import delete_all delete_all()
none
1
2.008073
2
dataProcessing/octree.py
zrtty1998/trafic-sptio-temporal-visualization
0
6623521
import math import os import random import shutil import pandas as pd import json def visualize(tree, size=10): from matplotlib import pyplot from mpl_toolkits.mplot3d import Axes3D, art3d def draw_all_nodes(node, ax): for pnt in node.points: ax.scatter3D(pnt.x, pnt.y, pnt.z, s=5) ...
import math import os import random import shutil import pandas as pd import json def visualize(tree, size=10): from matplotlib import pyplot from mpl_toolkits.mplot3d import Axes3D, art3d def draw_all_nodes(node, ax): for pnt in node.points: ax.scatter3D(pnt.x, pnt.y, pnt.z, s=5) ...
en
0.526005
# draw_lines(node) def draw_lines(node): bb = node.bounding_box # The scales for axhline & axvline are 0-1, so we have to convert # our values. x_offset = -tree._root.bounding_box.min_x min_x = (bb.min_x + x_offset) / 100 max_x = (bb.max_x + x_offset) / 100 y_of...
3.227127
3
24.py
lycantropos/Project-Euler
0
6623522
<filename>24.py<gh_stars>0 from itertools import (permutations, islice) from typing import Iterable def digits_lexicographic_permutation(*, digits: Iterable[int], index: int) -> int: return next(islice(permutations(di...
<filename>24.py<gh_stars>0 from itertools import (permutations, islice) from typing import Iterable def digits_lexicographic_permutation(*, digits: Iterable[int], index: int) -> int: return next(islice(permutations(di...
none
1
3.271427
3
models/config_sr.py
ustato/sber-swap
210
6623523
<reponame>ustato/sber-swap<gh_stars>100-1000 import sys class TestOptions(object): name = 'weights' results_dir = './results/' gpu_ids = [0] crop_size = 256 dataset_mode = 'test' which_epoch = '10' aspect_ratio = 1.0 checkpoints_dir = '' init_type = 'xavier' init_variance ...
import sys class TestOptions(object): name = 'weights' results_dir = './results/' gpu_ids = [0] crop_size = 256 dataset_mode = 'test' which_epoch = '10' aspect_ratio = 1.0 checkpoints_dir = '' init_type = 'xavier' init_variance = 0.02 isTrain = False is_test = True...
none
1
1.536384
2
game_mastering/models/file.py
SamusChief/myth-caster-api
0
6623524
""" Model for tracking file uploads to the server """ from django.db import models from common.models import PrivateModel class GameMasterFile(PrivateModel): """ Model to represent specific files. Attributes upload: the file uploaded to the server """ name = models.CharField(unique=True,...
""" Model for tracking file uploads to the server """ from django.db import models from common.models import PrivateModel class GameMasterFile(PrivateModel): """ Model to represent specific files. Attributes upload: the file uploaded to the server """ name = models.CharField(unique=True,...
en
0.957184
Model for tracking file uploads to the server Model to represent specific files. Attributes upload: the file uploaded to the server
2.748875
3
scripts/functions/models_transcript.py
ajlee21/cycleGAN_gene_expression
2
6623525
<gh_stars>1-10 import torch.nn as nn import torch.nn.functional as F import torch from torch.utils.data import DataLoader import pandas as pd import numpy as np def weights_init_normal(m): classname = m.__class__.__name__ if classname.find("Conv") != -1: torch.nn.init.normal_(m.weight.data, 0.0, 0.02)...
import torch.nn as nn import torch.nn.functional as F import torch from torch.utils.data import DataLoader import pandas as pd import numpy as np def weights_init_normal(m): classname = m.__class__.__name__ if classname.find("Conv") != -1: torch.nn.init.normal_(m.weight.data, 0.0, 0.02) if has...
de
0.35443
############################## # RESNET ############################## # Encoder (Downsampling) # Transformation (Residual blocks) # Decoder (Upsampling) # Output layer # model += [nn.ReflectionPad2d(channels), # nn.Conv2d(out_features, channels, 7), nn.Tanh()] ############################## # ...
2.917812
3
1_day/data_fiting.py
h-mayorquin/g_node_data_analysis_205
0
6623526
import numpy as np import matplotlib.pyplot as plt from load_data_depression import V_mean from scipy.signal import argrelextrema T_data = 1200 dt_data = 1000.0 / 4000 times_data = np.arange(0, T_data, dt_data) if True: plt.plot(V_mean, label='V_experiment') plt.legend() plt.ylim([-0.5, 3]) plt.hold(...
import numpy as np import matplotlib.pyplot as plt from load_data_depression import V_mean from scipy.signal import argrelextrema T_data = 1200 dt_data = 1000.0 / 4000 times_data = np.arange(0, T_data, dt_data) if True: plt.plot(V_mean, label='V_experiment') plt.legend() plt.ylim([-0.5, 3]) plt.hold(...
en
0.931947
# We need to extract a vector of the maximums # From all the maximus we extract those ones that are
2.566187
3
users/migrations/0004_auto_20200608_2230.py
a-samir97/mostql-project
0
6623527
# Generated by Django 3.0 on 2020-06-08 19:30 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('users', '0003_adminuser_is_blocked'), ] operations = [ migrations.RemoveFiel...
# Generated by Django 3.0 on 2020-06-08 19:30 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('users', '0003_adminuser_is_blocked'), ] operations = [ migrations.RemoveFiel...
en
0.819543
# Generated by Django 3.0 on 2020-06-08 19:30
1.619938
2
blog/models.py
robml/django_diy_blog
0
6623528
from django.db import models from django.contrib.auth.models import User from django.urls import reverse # Create your models here. class Blog(models.Model): """A model representing Blog Posts""" title=models.CharField(max_length=200) post_date = models.DateField(auto_now_add=True) author = models.Fore...
from django.db import models from django.contrib.auth.models import User from django.urls import reverse # Create your models here. class Blog(models.Model): """A model representing Blog Posts""" title=models.CharField(max_length=200) post_date = models.DateField(auto_now_add=True) author = models.Fore...
en
0.86304
# Create your models here. A model representing Blog Posts Returns the url to access a particular blog instance. Comments for each blog post Model representing Bloggers Returns the url to access a particular author instance.
2.875722
3
swf/actors/worker.py
nstott/simpleflow
0
6623529
# -*- coding:utf-8 -*- import boto.exception from simpleflow import format from swf.actors import Actor from swf.models import ActivityTask from swf.exceptions import PollTimeout, ResponseError, DoesNotExistError, RateLimitExceededError from swf.responses import Response class ActivityWorker(Actor): """Activity ...
# -*- coding:utf-8 -*- import boto.exception from simpleflow import format from swf.actors import Actor from swf.models import ActivityTask from swf.exceptions import PollTimeout, ResponseError, DoesNotExistError, RateLimitExceededError from swf.responses import Response class ActivityWorker(Actor): """Activity ...
en
0.801844
# -*- coding:utf-8 -*- Activity task worker actor implementation Once started, will start polling for activity task, to process, and emitting heartbeat until it's stopped or crashes for some reason. :param domain: Domain the Actor should interact with :type domain: swf.models.Domain :param...
2.439396
2
raw-input.py
eltechno/python_course
4
6623530
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Created by techno at 8/04/19 #Feature: #Enter feature name here # Enter feature description here #Scenario: # Enter scenario name here # Enter steps here str = ("uno, dos, tres") list = str.split(",") tuple= tuple(list) print('list : ', list) print('tuple: ', tupl...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Created by techno at 8/04/19 #Feature: #Enter feature name here # Enter feature description here #Scenario: # Enter scenario name here # Enter steps here str = ("uno, dos, tres") list = str.split(",") tuple= tuple(list) print('list : ', list) print('tuple: ', tupl...
en
0.696684
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Created by techno at 8/04/19 #Feature: #Enter feature name here # Enter feature description here #Scenario: # Enter scenario name here # Enter steps here
3.729296
4
hypergraph/representation/unipartite.py
antoneri/mapping-hypergraphs
10
6623531
<reponame>antoneri/mapping-hypergraphs from itertools import combinations_with_replacement, product from hypergraph.network import HyperGraph, Network from hypergraph.transition import w, P, pi def create_network(hypergraph: HyperGraph, directed: bool, self_links: bool) -> Network: nodes, edges, weights = hyperg...
from itertools import combinations_with_replacement, product from hypergraph.network import HyperGraph, Network from hypergraph.transition import w, P, pi def create_network(hypergraph: HyperGraph, directed: bool, self_links: bool) -> Network: nodes, edges, weights = hypergraph print("[unipartite] creating ...
none
1
2.95132
3
src/installer.py
atareao/start-here
35
6623532
#/usr/bin/env python3 # -*- coding: UTF-8 -*- # # This file is part of ubuntu-first-steps # # Copyright (c) 2020 <NAME> <a.k.a. atareao> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software with...
#/usr/bin/env python3 # -*- coding: UTF-8 -*- # # This file is part of ubuntu-first-steps # # Copyright (c) 2020 <NAME> <a.k.a. atareao> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software with...
en
0.735906
#/usr/bin/env python3 # -*- coding: UTF-8 -*- # # This file is part of ubuntu-first-steps # # Copyright (c) 2020 <NAME> <a.k.a. atareao> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software with...
1.77395
2
lib/bes/common/string_list_util.py
reconstruir/bes
0
6623533
#-*- coding:utf-8; mode:python; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- from bes.system.compat import compat from bes.compat.StringIO import StringIO from .string_util import string_util class string_list_util(object): 'string list helpers' @classmethod def remove_if(clazz, l, blacklist): ...
#-*- coding:utf-8; mode:python; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- from bes.system.compat import compat from bes.compat.StringIO import StringIO from .string_util import string_util class string_list_util(object): 'string list helpers' @classmethod def remove_if(clazz, l, blacklist): ...
en
0.595088
#-*- coding:utf-8; mode:python; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*-
2.594392
3
entrypoint/main.py
hlub/entrypoint
0
6623534
#!/usr/bin/env python3.7 # -*- coding: utf-8 -*- """Entrypoint main routine""" import logging import argparse import os import sys import traceback from jinja2.exceptions import TemplateSyntaxError import yaml from yaml.scanner import ScannerError from . import __version__ as version from .hooks import Hooks from . i...
#!/usr/bin/env python3.7 # -*- coding: utf-8 -*- """Entrypoint main routine""" import logging import argparse import os import sys import traceback from jinja2.exceptions import TemplateSyntaxError import yaml from yaml.scanner import ScannerError from . import __version__ as version from .hooks import Hooks from . i...
en
0.805623
#!/usr/bin/env python3.7 # -*- coding: utf-8 -*- Entrypoint main routine Replace the current entrypoint process with the actual command. Even the commandline arguments of the specified command are treated as templates. # if this point is reached, exec failed, so we should exit nonzero Return a dict of variables...
2.485435
2
itunesmusicsearch/result_item.py
fonrims/itunesmusicsearch
0
6623535
<gh_stars>0 #!/usr/bin/python class ResultItem(object): """ Defines a general result item """ def __init__(self, json): """ Initializes the ResultItem class from the JSON provided :param json: String. Raw JSON data to fetch information from """ self.artist_name =...
#!/usr/bin/python class ResultItem(object): """ Defines a general result item """ def __init__(self, json): """ Initializes the ResultItem class from the JSON provided :param json: String. Raw JSON data to fetch information from """ self.artist_name = json['artis...
en
0.69929
#!/usr/bin/python Defines a general result item Initializes the ResultItem class from the JSON provided :param json: String. Raw JSON data to fetch information from Retrieves all keys in the class as a String :return: String. All the keys available in the class
3.526493
4
2020-ucc/services/provenance-service/app/unfolding_utils.py
UST-QuAntiL/QuantME-UseCase
3
6623536
<reponame>UST-QuAntiL/QuantME-UseCase # ****************************************************************************** # Copyright (c) 2020 University of Stuttgart # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. # # Licensed under the Apache License,...
# ****************************************************************************** # Copyright (c) 2020 University of Stuttgart # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. # # Licensed under the Apache License, Version 2.0 (the "License"); # you m...
en
0.757559
# ****************************************************************************** # Copyright (c) 2020 University of Stuttgart # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. # # Licensed under the Apache License, Version 2.0 (the "License"); # you m...
1.724541
2
instagrapi/mixins/story.py
pip-install-HSE/instagrapi
0
6623537
<gh_stars>0 import json from copy import deepcopy from typing import List from instagrapi import config from instagrapi.exceptions import StoryNotFound from instagrapi.extractors import extract_story_gql, extract_story_v1 from instagrapi.types import Story, StoryQueue class StoryMixin: _stories_cache = {} # pk ...
import json from copy import deepcopy from typing import List from instagrapi import config from instagrapi.exceptions import StoryNotFound from instagrapi.extractors import extract_story_gql, extract_story_v1 from instagrapi.types import Story, StoryQueue class StoryMixin: _stories_cache = {} # pk -> object ...
en
0.464017
# pk -> object # def story_info_gql(self, story_pk: int): # # GQL havent video_url :-( # return self.media_info_gql(self, int(story_pk)) Get Story by pk or id Parameters ---------- story_pk: int Unique identifier of the story Returns ------- Story ...
2.407413
2
port_scanner.py
RasbeeTech/Simple-Port-Scanner
1
6623538
import socket import re from common_ports import ports_and_services def get_open_ports(target, port_range, verbose=False): open_ports = [] address = '' hostname = '' # validate target if re.search('^[0-9\.]*$', target): try: name, alias, addresslist = socket.gethostbyaddr(targe...
import socket import re from common_ports import ports_and_services def get_open_ports(target, port_range, verbose=False): open_ports = [] address = '' hostname = '' # validate target if re.search('^[0-9\.]*$', target): try: name, alias, addresslist = socket.gethostbyaddr(targe...
en
0.382535
# validate target # Scan ports # return [open_ports] # Stringify
3.242058
3
scripts/tshark.py
anzigly/pycoflow
1
6623539
<reponame>anzigly/pycoflow<filename>scripts/tshark.py #!/usr/bin/python import subprocess def run_tshark(slaves_file): proc = [] with open(slaves_file) as f: for h in f.readlines(): if h.startswith("#"): continue host = h.strip() cmd = 'ssh root@%s ...
#!/usr/bin/python import subprocess def run_tshark(slaves_file): proc = [] with open(slaves_file) as f: for h in f.readlines(): if h.startswith("#"): continue host = h.strip() cmd = 'ssh root@%s nohup tshark -i eth0 -s 100 -w ts.pcap "tcp" &' % host...
ru
0.258958
#!/usr/bin/python
2.553725
3
src/agx/generator/uml/interfaces.py
bluedynamics/agx.generator.uml
1
6623540
<filename>src/agx/generator/uml/interfaces.py from zope.interface import Attribute from node.interfaces import INode from agx.core.interfaces import IScope class IXMLScope(IScope): """XML specific scope interface. Uses tag names for scope identification instead of interfaces. """ tags = Attribute(u"...
<filename>src/agx/generator/uml/interfaces.py from zope.interface import Attribute from node.interfaces import INode from agx.core.interfaces import IScope class IXMLScope(IScope): """XML specific scope interface. Uses tag names for scope identification instead of interfaces. """ tags = Attribute(u"...
en
0.651149
XML specific scope interface. Uses tag names for scope identification instead of interfaces.
1.632038
2
src/preprocessing/prepare_craft.py
norikinishida/coreference-resolution
0
6623541
from collections import defaultdict import unicodedata import os import re import utils CONLL_KEYS = ["_0", "_1", "token-index", "token", "pos", "_5", "_6", "_7", "_8", "_9", "_10", "_11", "span-exp"] def main(): config = utils.get_hocon_config(config_path="./config/main.conf", config_name="path") path_conl...
from collections import defaultdict import unicodedata import os import re import utils CONLL_KEYS = ["_0", "_1", "token-index", "token", "pos", "_5", "_6", "_7", "_8", "_9", "_10", "_11", "span-exp"] def main(): config = utils.get_hocon_config(config_path="./config/main.conf", config_name="path") path_conl...
ja
0.942595
# 辞書 (CoNLLファイル名 -> training/dev/test split) の作成 # CoNLLファイルリスト # CoNLLデータ読み込み # トークン正規化 # もしCoNLLデータにて、一つの単語が空白分割で複数個のパーツに別れるなら、それらを"-"で1単語に結合しておく # (後のコードで空白でトークン分割するために) # BioNLPデータ読み込み # CoNLLデータとBioNLPデータで文数が一致するかチェック # i.e., すべての文がいずれかのセクションに含まれているか # CoNLLデータの保存 # テキストデータに変換、保存 # セクション境界、文境界の保存 # Chains抽出 # 辞書に変...
2.170014
2
tests/test_vision.py
karthik20122001/docker-python
2,030
6623542
import unittest import inspect from unittest.mock import Mock, patch from kaggle_gcp import KaggleKernelCredentials, init_vision from test.support import EnvironmentVarGuard from google.cloud import vision def _make_credentials(): import google.auth.credentials return Mock(spec=google.auth.credentials.Creden...
import unittest import inspect from unittest.mock import Mock, patch from kaggle_gcp import KaggleKernelCredentials, init_vision from test.support import EnvironmentVarGuard from google.cloud import vision def _make_credentials(): import google.auth.credentials return Mock(spec=google.auth.credentials.Creden...
none
1
2.373434
2
testPython/test3.py
lijie28/python_demo
0
6623543
<filename>testPython/test3.py # -*- coding:utf-8*- import sys reload(sys) sys.setdefaultencoding('utf-8') import os import os.path from pyPdf import PdfFileReader,PdfFileWriter import time time1=time.time() # 使用os模块walk函数,搜索出某目录下的全部pdf文件 ######################获取同一个文件夹下的所有PDF文件名####################### def getFileNam...
<filename>testPython/test3.py # -*- coding:utf-8*- import sys reload(sys) sys.setdefaultencoding('utf-8') import os import os.path from pyPdf import PdfFileReader,PdfFileWriter import time time1=time.time() # 使用os模块walk函数,搜索出某目录下的全部pdf文件 ######################获取同一个文件夹下的所有PDF文件名####################### def getFileNam...
zh
0.70169
# -*- coding:utf-8*- # 使用os模块walk函数,搜索出某目录下的全部pdf文件 ######################获取同一个文件夹下的所有PDF文件名####################### # print(os.path.join(root,filespath)) ##########################合并同一个文件夹下所有PDF文件######################## # print '看看',os.path.dirname(each),'+', os.path.splitext(each.replace(os.path.dirname(each),'')) # ...
2.968939
3
arcpy_extensions/server_admin.py
jkeifer/arcpy-extensions
1
6623544
<filename>arcpy_extensions/server_admin.py from __future__ import print_function import os import sys import urllib import urllib2 import httplib import arcpy import json import re from arcpy import env class ServiceException(Exception): pass class AgsAdmin(object): def __init__(self, serve...
<filename>arcpy_extensions/server_admin.py from __future__ import print_function import os import sys import urllib import urllib2 import httplib import arcpy import json import re from arcpy import env class ServiceException(Exception): pass class AgsAdmin(object): def __init__(self, serve...
en
0.746096
Get a token required for Admin changes Function to stop, start or delete a service. Requires token, server, and port. command = Stop|Start|Delete serviceList = List of services. A service must be in the <name>.<type> notation # test if name filter is valid regex # This request only needs the ...
2.638635
3
ProjectApplication/project_core/migrations/0112_physical_person_add_orcid.py
code-review-doctor/project-application
5
6623545
<gh_stars>1-10 # Generated by Django 3.0.3 on 2020-03-20 15:26 import django.core.validators from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('project_core', '0111_remove_project_duration_months'), ] operations = [ migrations.AddField( ...
# Generated by Django 3.0.3 on 2020-03-20 15:26 import django.core.validators from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('project_core', '0111_remove_project_duration_months'), ] operations = [ migrations.AddField( model...
en
0.765362
# Generated by Django 3.0.3 on 2020-03-20 15:26
1.860766
2
citation.py
wangzefan666/SGC
1
6623546
import torch import torch.nn.functional as F import torch.optim as optim from utils import load_citation, sgc_precompute, set_seed from models import get_model from metrics import accuracy import pickle as pkl from args import get_citation_args from time import perf_counter from models import GCN # 加载参数 args = get_cit...
import torch import torch.nn.functional as F import torch.optim as optim from utils import load_citation, sgc_precompute, set_seed from models import get_model from metrics import accuracy import pickle as pkl from args import get_citation_args from time import perf_counter from models import GCN # 加载参数 args = get_cit...
zh
0.593771
# 加载参数 # 模型微调 # 读取微调超参数 - 权重衰减 # 设置随机种子,固定结果 # 邻接矩阵(归一化),特征,标签,训练集,验证集,测试集 # 模型 SGC or GCN # 预计算 (S^K * X) # optimizer = optim.Adam(model.parameters(), lr=lr, weight_decay=weight_decay) # LBFGS专用 # if args.model == "SGC":
2.33598
2
monlan/agents/CompositeAgent.py
CameleoGrey/Monlan
3
6623547
import numpy as np from copy import deepcopy from datetime import datetime class CompositeAgent(): def __init__(self, opener, holdBuyer, holdSeller): self.agents = { "opener": opener, "buy": holdBuyer, "sell": holdSeller } self.openerActionsDict = {0:...
import numpy as np from copy import deepcopy from datetime import datetime class CompositeAgent(): def __init__(self, opener, holdBuyer, holdSeller): self.agents = { "opener": opener, "buy": holdBuyer, "sell": holdSeller } self.openerActionsDict = {0:...
en
0.31572
# do opener action # if action == hold add experience to opener # else save state of open state and switch active agent to closer # while not close add experience to closer # if close position then add experience to closer, switch to opener # add saved obs, action and reward of closed position to opener too # repeat op...
2.316909
2
project_tools/nrcan_p2/evaluation/bert_keyword_prediction.py
NRCan/Geoscience_Language_Models
0
6623548
# coding=utf-8 # Copyright (C) 2021 ServiceNow, Inc. """ Finetuning for running PAIRING and MULTICLASS-MULTILABEL classification finetuning on NRCan data and the original Glue benchmarks This script is a SIGNIFICANTLY MODIFIED version of the run_glue.py script provided by HuggingFace in the Transformers r...
# coding=utf-8 # Copyright (C) 2021 ServiceNow, Inc. """ Finetuning for running PAIRING and MULTICLASS-MULTILABEL classification finetuning on NRCan data and the original Glue benchmarks This script is a SIGNIFICANTLY MODIFIED version of the run_glue.py script provided by HuggingFace in the Transformers r...
en
0.820452
# coding=utf-8 # Copyright (C) 2021 ServiceNow, Inc. Finetuning for running PAIRING and MULTICLASS-MULTILABEL classification finetuning on NRCan data and the original Glue benchmarks This script is a SIGNIFICANTLY MODIFIED version of the run_glue.py script provided by HuggingFace in the Transformers repo:...
2.181347
2
src/learners/DLGGTD.py
dylanashley/direct-lambda-greedy
0
6623549
<gh_stars>0 # -*- coding: ascii -*- import numpy as np from .GTD import GTD class DLGGTD: EPS = 1e-3 def __init__(self, initial_x, initial_gamma, max_reward): assert (len(initial_x.shape) == 1) n = len(initial_x) self._last_gamma = initial_gamma self._GTD = GTD(initial_x) ...
# -*- coding: ascii -*- import numpy as np from .GTD import GTD class DLGGTD: EPS = 1e-3 def __init__(self, initial_x, initial_gamma, max_reward): assert (len(initial_x.shape) == 1) n = len(initial_x) self._last_gamma = initial_gamma self._GTD = GTD(initial_x) self....
en
0.617801
# -*- coding: ascii -*- Return the current prediction for a given set of features x. # use GTD to update w_err # use GTD to update w_var # compute lambda estimate
2.775983
3
Chapter07.StringFundamentals/convert_binary_digit_to_integer.py
mindnhand/Learning-Python-5th
0
6623550
<reponame>mindnhand/Learning-Python-5th<filename>Chapter07.StringFundamentals/convert_binary_digit_to_integer.py #!/usr/bin/env python3 #encoding=utf-8 #--------------------------------------------------------------- # Usage: python3 convert_binary_digit_to_integer.py binary_digit # Description: 将二进制输入参数转换为十进制数并打印到标准...
#!/usr/bin/env python3 #encoding=utf-8 #--------------------------------------------------------------- # Usage: python3 convert_binary_digit_to_integer.py binary_digit # Description: 将二进制输入参数转换为十进制数并打印到标准输出 #--------------------------------------------------------------- import sys ''' execution result in command...
en
0.165276
#!/usr/bin/env python3 #encoding=utf-8 #--------------------------------------------------------------- # Usage: python3 convert_binary_digit_to_integer.py binary_digit # Description: 将二进制输入参数转换为十进制数并打印到标准输出 #--------------------------------------------------------------- execution result in command line: ~]# python3 c...
4.168561
4