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
misago/misago/markup/pipeline.py
vascoalramos/misago-deployment
2
6625951
from importlib import import_module from bs4 import BeautifulSoup from .. import hooks from ..conf import settings class MarkupPipeline: """small framework for extending parser""" def extend_markdown(self, md): for extension in settings.MISAGO_MARKUP_EXTENSIONS: module = import_module(e...
from importlib import import_module from bs4 import BeautifulSoup from .. import hooks from ..conf import settings class MarkupPipeline: """small framework for extending parser""" def extend_markdown(self, md): for extension in settings.MISAGO_MARKUP_EXTENSIONS: module = import_module(e...
en
0.617929
small framework for extending parser
2.58963
3
ebnmpy/point_laplace.py
kclamar/ebnmpy
0
6625952
import numpy as np from numpy import exp, inf, log, mean, sqrt from scipy.stats import bernoulli from .ashr import my_e2truncnorm, my_etruncnorm from .output import result_in_output from .r_utils import length, numeric, pmax, pmin, rep, stop, unlist from .r_utils.stats import dnorm, pnorm, rtruncnorm from .workhorse_p...
import numpy as np from numpy import exp, inf, log, mean, sqrt from scipy.stats import bernoulli from .ashr import my_e2truncnorm, my_etruncnorm from .output import result_in_output from .r_utils import length, numeric, pmax, pmin, rep, stop, unlist from .r_utils.stats import dnorm, pnorm, rtruncnorm from .workhorse_p...
none
1
2.16533
2
encoder-decoder-train_1.py
kapitsa2811/uTAB
0
6625953
import numpy as np np.random.seed(1000) # for reproducibility from keras.models import Sequential from keras.layers.convolutional import Convolution2D from keras.layers import Activation from keras.layers import MaxPooling2D,UpSampling2D from keras.layers import Dropout,Dense,Flatten,BatchNormalization from keras.optim...
import numpy as np np.random.seed(1000) # for reproducibility from keras.models import Sequential from keras.layers.convolutional import Convolution2D from keras.layers import Activation from keras.layers import MaxPooling2D,UpSampling2D from keras.layers import Dropout,Dense,Flatten,BatchNormalization from keras.optim...
en
0.211887
# for reproducibility this code is modified for new segmentaion angles = range(-2,3) shifts = [[0,0],[0,1],[1,0],[1,1],[0,2],[2,0],[1,2],[2,1],[2,2], [0,-1],[-1,0],[-1,-1],[0,-2],[-2,0],[-1,-2],[-2,-1],[-2,-2], [1,-1],[1,-2],[2,-1],[2,-2], [-1,1],[-1,2],[-2,1],[-2,2]] mul...
2.333805
2
test/mapreduce/data/stream_data.py
chuyqa/pydoop
0
6625954
# BEGIN_COPYRIGHT # # Copyright 2009-2018 CRS4. # # 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 ...
# BEGIN_COPYRIGHT # # Copyright 2009-2018 CRS4. # # 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.823592
# BEGIN_COPYRIGHT # # Copyright 2009-2018 CRS4. # # 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 ...
1.669763
2
src/decimal_to_octal/main.py
pranshuag9/my-hackerblocks-codes
0
6625955
''' @author: <NAME> @problem: https://hack.codingblocks.com/app/practice/1/217/problem ''' def decimal_to_octal(n): i, BASE, sum = 0, 8, 0 while n > 0: rem = n % BASE sum += rem * (10**i) n = int(n / BASE) i += 1 print(sum) if __name__ == "__main__": n = in...
''' @author: <NAME> @problem: https://hack.codingblocks.com/app/practice/1/217/problem ''' def decimal_to_octal(n): i, BASE, sum = 0, 8, 0 while n > 0: rem = n % BASE sum += rem * (10**i) n = int(n / BASE) i += 1 print(sum) if __name__ == "__main__": n = in...
en
0.584632
@author: <NAME> @problem: https://hack.codingblocks.com/app/practice/1/217/problem
3.844155
4
src/compute.client/python_client/compute_rhino3d/Curve.py
tt-acm/compute.rhino3d
1
6625956
from . import Util def GetConicSectionType(thisCurve, multiple=False): url = "rhino/geometry/curve/getconicsectiontype-curve" if multiple: url += "?multiple=true" args = [thisCurve] if multiple: args = zip(thisCurve) response = Util.ComputeFetch(url, args) return response def CreateInterpola...
from . import Util def GetConicSectionType(thisCurve, multiple=False): url = "rhino/geometry/curve/getconicsectiontype-curve" if multiple: url += "?multiple=true" args = [thisCurve] if multiple: args = zip(thisCurve) response = Util.ComputeFetch(url, args) return response def CreateInterpola...
none
1
2.479616
2
src/presets.py
slobos/datanga
0
6625957
<filename>src/presets.py<gh_stars>0 from PySide.QtCore import * from PySide.QtWebKit import * from PySide.QtGui import * import os import sys import re import json from textviewer import * from urlparse import urlparse import requests class PresetWindow(QDialog): def __init__(self, parent=None): super(Pres...
<filename>src/presets.py<gh_stars>0 from PySide.QtCore import * from PySide.QtWebKit import * from PySide.QtGui import * import os import sys import re import json from textviewer import * from urlparse import urlparse import requests class PresetWindow(QDialog): def __init__(self, parent=None): super(Pres...
en
0.146027
#layout #list view #detail view #self.detailView.setFrameStyle(QFrame.Box) #self.detailOptions.setStyleSheet("background: rgba(0,0,0,0);border:0px;") #self.detailColumns.setStyleSheet("background: rgba(0,0,0,0);border:0px;") #buttons #QDialogButtonBox() #buttons.addButton(self.saveButton,QDialogButtonBox.ActionRole) #b...
2.135059
2
pytube/models.py
thedataincubator/pytube
0
6625958
<filename>pytube/models.py #!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals from os.path import normpath, isfile from os import remove from time import clock try: from urllib2 import urlopen except ImportError: from urllib.request import urlopen from sys import exit from pyt...
<filename>pytube/models.py #!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals from os.path import normpath, isfile from os import remove from time import clock try: from urllib2 import urlopen except ImportError: from urllib.request import urlopen from sys import exit from pyt...
en
0.788088
#!/usr/bin/env python # -*- coding: utf-8 -*- Class representation of a single instance of a YouTube video. Define the variables required to declare a new video. Keyword arguments: extention -- The file extention the video should be saved as. resolution -- The broadcasting standard of the video...
3.09991
3
backend/app.py
IndiaCFG2/team-19
0
6625959
from flask import Flask, jsonify, request from flask_sqlalchemy import SQLAlchemy from flask_marshmallow import Marshmallow import os app = Flask(__name__) basedir = os.path.abspath(os.path.dirname(__file__)) app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + os.path.join(basedir,'db.sqlite') app.config['SQLALCHE...
from flask import Flask, jsonify, request from flask_sqlalchemy import SQLAlchemy from flask_marshmallow import Marshmallow import os app = Flask(__name__) basedir = os.path.abspath(os.path.dirname(__file__)) app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + os.path.join(basedir,'db.sqlite') app.config['SQLALCHE...
none
1
2.389867
2
calvin_models/calvin_agent/utils/data_visualization.py
nikepupu/calvin
0
6625960
<gh_stars>0 import logging import hydra from omegaconf import DictConfig from pytorch_lightning import seed_everything logger = logging.getLogger(__name__) from matplotlib.animation import ArtistAnimation import matplotlib.pyplot as plt import numpy as np def visualize(data): seq_img = data[1][0][0].numpy() ...
import logging import hydra from omegaconf import DictConfig from pytorch_lightning import seed_everything logger = logging.getLogger(__name__) from matplotlib.animation import ArtistAnimation import matplotlib.pyplot as plt import numpy as np def visualize(data): seq_img = data[1][0][0].numpy() title = da...
en
0.640333
# imgRGB = seq_img[j].astype(int) # sets seeds for numpy, torch, python.random and PYTHONHASHSEED.
2.219921
2
skytap/models/Interface.py
mapledyne/skytap
3
6625961
<filename>skytap/models/Interface.py """Support for an interface resource in Skytap.""" import json from skytap.framework.ApiClient import ApiClient # noqa from skytap.models.PublishedServices import PublishedServices # noqa from skytap.models.SkytapResource import SkytapResource # noqa class Interface(SkytapReso...
<filename>skytap/models/Interface.py """Support for an interface resource in Skytap.""" import json from skytap.framework.ApiClient import ApiClient # noqa from skytap.models.PublishedServices import PublishedServices # noqa from skytap.models.SkytapResource import SkytapResource # noqa class Interface(SkytapReso...
en
0.945481
Support for an interface resource in Skytap. # noqa # noqa # noqa One Skytap (network) Interface. Get attributes. Interfaces aren't fully returned when the API call is made - Published Services aren't returned. Often this doesn't matter, so we don't automatically pull this information. However,...
2.944456
3
egs/word_embedding/steps/tfrnnlm/rnnlm_skipgram.py
charlesliucn/LanMIT
17
6625962
# -*- coding:utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import sys import time import math import random import reader import inspect import collections import numpy as np import tensorflow as tf reload(sys) sys.setdefaultencoding("...
# -*- coding:utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import sys import time import math import random import reader import inspect import collections import numpy as np import tensorflow as tf reload(sys) sys.setdefaultencoding("...
en
0.52892
# -*- coding:utf-8 -*- Small config. The input data. The RNNLM model. # first implement the less efficient version # unpacking the input state context # self.embedding = tf.get_variable("embedding", [vocab_size, hidden_size], dtype = tf.float32) # inputs = tf.nn.embedding_lookup(self.embedding, input_.input_data) # tes...
2.296048
2
mean_median_mode/mean_median_mode.py
arunachalamb/hackerrank
1
6625963
# Input: # N - number of elements in list # Input list to calculate mean, median, mode # Output: # Print mean, median and mode of elements in list n = int(input()) l = [int(i) for i in input().split()] print(sum(l)/n) l.sort() if n%2 == 1: print(l[n//2]) else: print((l[n//2-1]+l[n//2])/2) m = [0 for i in range...
# Input: # N - number of elements in list # Input list to calculate mean, median, mode # Output: # Print mean, median and mode of elements in list n = int(input()) l = [int(i) for i in input().split()] print(sum(l)/n) l.sort() if n%2 == 1: print(l[n//2]) else: print((l[n//2-1]+l[n//2])/2) m = [0 for i in range...
en
0.766471
# Input: # N - number of elements in list # Input list to calculate mean, median, mode # Output: # Print mean, median and mode of elements in list
3.560808
4
tests/test_mot_metrics.py
itsraina/norfair
0
6625964
<reponame>itsraina/norfair import os.path import numpy as np import pandas as pd from norfair import Tracker, metrics DATASET_PATH = "train" MOTA_ERROR_THRESHOLD = 0.0 FRAME_SKIP_PERIOD = 1 DETECTION_THRESHOLD = 0.01 DISTANCE_THRESHOLD = 0.9 DIAGONAL_PROPORTION_THRESHOLD = 1 / 18 POINTWISE_HIT_COUNTER_MAX = 3 HIT_C...
import os.path import numpy as np import pandas as pd from norfair import Tracker, metrics DATASET_PATH = "train" MOTA_ERROR_THRESHOLD = 0.0 FRAME_SKIP_PERIOD = 1 DETECTION_THRESHOLD = 0.01 DISTANCE_THRESHOLD = 0.9 DIAGONAL_PROPORTION_THRESHOLD = 1 / 18 POINTWISE_HIT_COUNTER_MAX = 3 HIT_COUNTER_MAX = 2 def keypoin...
en
0.922253
# Set keypoint_dist_threshold based on object size, and calculate # distance between detections and tracker estimations Tests that Norfair's MOT metrics didn't get worse Configurable so that it allows some margin on how much worse metrics could get before the test fails. Margin configured through MOTA_ERROR_...
2.549433
3
bundle_cache/app_store/tk-flame/v1.14.4/engine.py
ColinKennedy/tk-config-default2-respawn
4
6625965
# Copyright (c) 2014 Shotgun Software Inc. # # CONFIDENTIAL AND PROPRIETARY # # This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit # Source Code License included in this distribution package. See LICENSE. # By accessing, using, copying or modifying this work you indicate your # agreement to the S...
# Copyright (c) 2014 Shotgun Software Inc. # # CONFIDENTIAL AND PROPRIETARY # # This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit # Source Code License included in this distribution package. See LICENSE. # By accessing, using, copying or modifying this work you indicate your # agreement to the S...
en
0.850486
# Copyright (c) 2014 Shotgun Software Inc. # # CONFIDENTIAL AND PROPRIETARY # # This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit # Source Code License included in this distribution package. See LICENSE. # By accessing, using, copying or modifying this work you indicate your # agreement to the S...
1.969498
2
elastic/datadog_checks/elastic/metrics.py
keisku/integrations-core
0
6625966
<filename>elastic/datadog_checks/elastic/metrics.py # (C) Datadog, Inc. 2018-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) from .utils import byte_to_mebibyte, ms_to_second # Metrics definition format is a dictionary mapping: # datadog_metric_name --> (datadog_metric_type, e...
<filename>elastic/datadog_checks/elastic/metrics.py # (C) Datadog, Inc. 2018-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) from .utils import byte_to_mebibyte, ms_to_second # Metrics definition format is a dictionary mapping: # datadog_metric_name --> (datadog_metric_type, e...
en
0.747144
# (C) Datadog, Inc. 2018-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) # Metrics definition format is a dictionary mapping: # datadog_metric_name --> (datadog_metric_type, es_metric_name, optional_conversion_func) # Clusterwise metrics, pre aggregated on ES, compatible with a...
1.855798
2
penman/interface.py
rafaelanchieta/AMR-Aligner
2
6625967
""" Functions for basic reading and writing of PENMAN graphs. """ from typing import Union, Iterable, List from pathlib import Path from penman.codec import PENMANCodec from penman.model import Model from penman.graph import Graph from penman.types import (Variable, file_or_filename) def decode(s: str, ...
""" Functions for basic reading and writing of PENMAN graphs. """ from typing import Union, Iterable, List from pathlib import Path from penman.codec import PENMANCodec from penman.model import Model from penman.graph import Graph from penman.types import (Variable, file_or_filename) def decode(s: str, ...
en
0.726693
Functions for basic reading and writing of PENMAN graphs. Deserialize PENMAN-serialized *s* into its Graph object Args: s: a string containing a single PENMAN-serialized graph model: the model used for interpreting the graph Returns: the Graph object described by *s* Example: ...
3.309209
3
tests/test_PCA.py
gdalessi/clustering
7
6625968
''' MODULE: test_PCA.py @Authors: <NAME> [1,2] [1]: Université Libre de Bruxelles, Aero-Thermo-Mechanics Laboratory, Bruxelles, Belgium [2]: CRECK Modeling Lab, Department of Chemistry, Materials and Chemical Engineering, Politecnico di Milano @Contacts: <EMAIL> @Additional notes: This code is d...
''' MODULE: test_PCA.py @Authors: <NAME> [1,2] [1]: Université Libre de Bruxelles, Aero-Thermo-Mechanics Laboratory, Bruxelles, Belgium [2]: CRECK Modeling Lab, Department of Chemistry, Materials and Chemical Engineering, Politecnico di Milano @Contacts: <EMAIL> @Additional notes: This code is d...
en
0.714394
MODULE: test_PCA.py @Authors: <NAME> [1,2] [1]: Université Libre de Bruxelles, Aero-Thermo-Mechanics Laboratory, Bruxelles, Belgium [2]: CRECK Modeling Lab, Department of Chemistry, Materials and Chemical Engineering, Politecnico di Milano @Contacts: <EMAIL> @Additional notes: This code is distr...
2.169346
2
tests/test_web_app.py
agronholm/aiohttp
0
6625969
import asyncio from unittest import mock import pytest from async_generator import async_generator, yield_ from aiohttp import log, web from aiohttp.abc import AbstractAccessLogger, AbstractRouter from aiohttp.helpers import DEBUG, PY_36 from aiohttp.test_utils import make_mocked_coro async def test_app_ctor() -> N...
import asyncio from unittest import mock import pytest from async_generator import async_generator, yield_ from aiohttp import log, web from aiohttp.abc import AbstractAccessLogger, AbstractRouter from aiohttp.helpers import DEBUG, PY_36 from aiohttp.test_utils import make_mocked_coro async def test_app_ctor() -> N...
none
1
2.125969
2
python/Django/venv/djangoschool/school/models.py
Pitoontakoonpol/Python
0
6625970
from django.db import models class ExamScore(models.Model): allsubject = (('math', 'คณิตศาสตร์'), ('sci', 'วิทยาศาสตร์'), ('eng', 'ภาษาอังกฤษ'), ('art', 'ศิลป์'), ('physics', 'ฟิสิกส์'), ('bio', 'ชีววิทยา') ...
from django.db import models class ExamScore(models.Model): allsubject = (('math', 'คณิตศาสตร์'), ('sci', 'วิทยาศาสตร์'), ('eng', 'ภาษาอังกฤษ'), ('art', 'ศิลป์'), ('physics', 'ฟิสิกส์'), ('bio', 'ชีววิทยา') ...
none
1
2.309561
2
projeto001/qt_divisores.py
gerssivaldosantos/MeuGuru
1
6625971
def qtd_divisores(numero): contador = 0 """ Percorrendo do 1 ao número e verificando se o resto de divisão de cada número no intervalo é igual à zero, caso seja, adição ao contador """ for i in range(1, numero + 1): if numero % i == 0: print(i) contador += 1 return co...
def qtd_divisores(numero): contador = 0 """ Percorrendo do 1 ao número e verificando se o resto de divisão de cada número no intervalo é igual à zero, caso seja, adição ao contador """ for i in range(1, numero + 1): if numero % i == 0: print(i) contador += 1 return co...
pt
0.945307
Percorrendo do 1 ao número e verificando se o resto de divisão de cada número no intervalo é igual à zero, caso seja, adição ao contador
3.780334
4
comet/train/quantize.py
kearnsw/comet-commonsense
0
6625972
import torch from comet.interactive import functions as interactive import comet.train.atomic_train as train from comet.train.opt import OpenAIAdam import comet.data.config as cfg num_calibration_batches = 10 opt, state_dict = interactive.load_model_file("models/6.25e-05_adam_64_20500.pickle") data_loader, text_enco...
import torch from comet.interactive import functions as interactive import comet.train.atomic_train as train from comet.train.opt import OpenAIAdam import comet.data.config as cfg num_calibration_batches = 10 opt, state_dict = interactive.load_model_file("models/6.25e-05_adam_64_20500.pickle") data_loader, text_enco...
en
0.622898
# Specify quantization configuration # Start with simple min/max range estimation and per-tensor quantization of weights # Calibrate first # Calibrate with the training set # Convert to quantized model #top1, top5 = evaluate(myModel, criterion, data_loader_test, neval_batches=num_eval_batches) #print('Evaluation accura...
2.027939
2
src/annotateGenome/__init__.py
hui-sheen/annotateGenome
0
6625973
<filename>src/annotateGenome/__init__.py name = "annotate_genome"
<filename>src/annotateGenome/__init__.py name = "annotate_genome"
none
1
1.010023
1
examples/dbm_cifar_naive.py
enijkamp/rbm
0
6625974
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Train 3072-5000-1000 Gaussian-Bernoulli-Multinomial DBM with pre-training on "smoothed" CIFAR-10 (with 1000 least significant singular values removed), as suggested in [1]. Per sample validation mean reconstruction error for DBM monotonically decreases during training ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Train 3072-5000-1000 Gaussian-Bernoulli-Multinomial DBM with pre-training on "smoothed" CIFAR-10 (with 1000 least significant singular values removed), as suggested in [1]. Per sample validation mean reconstruction error for DBM monotonically decreases during training ...
en
0.842494
#!/usr/bin/env python # -*- coding: utf-8 -*- Train 3072-5000-1000 Gaussian-Bernoulli-Multinomial DBM with pre-training on "smoothed" CIFAR-10 (with 1000 least significant singular values removed), as suggested in [1]. Per sample validation mean reconstruction error for DBM monotonically decreases during training from...
2.481646
2
insights/formats/_yaml.py
dehort/insights-core
0
6625975
import yaml from insights.formats import EvaluatorFormatter class YamlFormatter(EvaluatorFormatter): def dump(self, data): return yaml.dump(data)
import yaml from insights.formats import EvaluatorFormatter class YamlFormatter(EvaluatorFormatter): def dump(self, data): return yaml.dump(data)
none
1
2.241846
2
networkapi/plugins/Cisco/NXOS/plugin.py
vinicius-marinho/GloboNetworkAPI
73
6625976
# -*- coding: utf-8 -*- # 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 "Lic...
# -*- coding: utf-8 -*- # 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 "Lic...
en
0.845558
# -*- coding: utf-8 -*- # 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 "Lic...
1.739264
2
scripts/create_fluseverity_figs_v5/S_seasonRR_benchmark_v5.py
eclee25/flu-SDI-exploratory-age
3
6625977
#!/usr/bin/python ############################################## ###Python template ###Author: <NAME> ###Date: 1/20/15 ###Function: relative risk of adult ILI to child ILI visits for the entire season vs. CDC benchmark index, mean Thanksgiving-based early zOR metric vs. CDC benchmark index. # 7/20/15: update beta # 1...
#!/usr/bin/python ############################################## ###Python template ###Author: <NAME> ###Date: 1/20/15 ###Function: relative risk of adult ILI to child ILI visits for the entire season vs. CDC benchmark index, mean Thanksgiving-based early zOR metric vs. CDC benchmark index. # 7/20/15: update beta # 1...
en
0.590021
#!/usr/bin/python ############################################## ###Python template ###Author: <NAME> ###Date: 1/20/15 ###Function: relative risk of adult ILI to child ILI visits for the entire season vs. CDC benchmark index, mean Thanksgiving-based early zOR metric vs. CDC benchmark index. # 7/20/15: update beta # 10/...
1.844682
2
clickhouse_driver/settings/types.py
vsmaxim/clickhouse-driver
17
6625978
<gh_stars>10-100 from ..varint import write_varint from ..writer import write_binary_str class SettingType(object): @classmethod def write(cls, value, buf): raise NotImplementedError class SettingUInt64(SettingType): @classmethod def write(cls, value, buf): write_varint(int(value), ...
from ..varint import write_varint from ..writer import write_binary_str class SettingType(object): @classmethod def write(cls, value, buf): raise NotImplementedError class SettingUInt64(SettingType): @classmethod def write(cls, value, buf): write_varint(int(value), buf) class Setti...
en
0.950204
Float is written in string representation.
2.866163
3
tests/test_query.py
Mc01/graphene-pydantic
0
6625979
<filename>tests/test_query.py import uuid import pydantic import graphene from graphene_pydantic_fix import PydanticObjectType class FooModel(pydantic.BaseModel): id: uuid.UUID name: str class Foo(PydanticObjectType): class Meta: model = FooModel class Query(graphene.ObjectType): list_fo...
<filename>tests/test_query.py import uuid import pydantic import graphene from graphene_pydantic_fix import PydanticObjectType class FooModel(pydantic.BaseModel): id: uuid.UUID name: str class Foo(PydanticObjectType): class Meta: model = FooModel class Query(graphene.ObjectType): list_fo...
en
0.618568
Dummy resolver that creates a list of Pydantic objects query { listFoos { id name } }
2.61833
3
warehouse/utils/webauthn.py
pradyunsg/warehouse
1
6625980
<reponame>pradyunsg/warehouse # 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, softw...
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the Li...
en
0.818275
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the Li...
2.175672
2
jsk_recognition/jsk_pcl_ros/scripts/install_trained_data.py
VT-ASIM-LAB/autoware.ai
0
6625981
<filename>jsk_recognition/jsk_pcl_ros/scripts/install_trained_data.py #!/usr/bin/env python import argparse import multiprocessing import jsk_data def main(): parser = argparse.ArgumentParser() parser.add_argument('-v', '--verbose', dest='quiet', action='store_false') args = parser.parse_args() quie...
<filename>jsk_recognition/jsk_pcl_ros/scripts/install_trained_data.py #!/usr/bin/env python import argparse import multiprocessing import jsk_data def main(): parser = argparse.ArgumentParser() parser.add_argument('-v', '--verbose', dest='quiet', action='store_false') args = parser.parse_args() quie...
ru
0.26433
#!/usr/bin/env python
2.132307
2
elegy/__init__.py
srcolinas/elegy
0
6625982
<filename>elegy/__init__.py __version__ = "0.1.3" from . import losses, metrics, model, regularizers, callbacks from .losses import Loss from .metrics import Metric from .model import Model from .module import Module
<filename>elegy/__init__.py __version__ = "0.1.3" from . import losses, metrics, model, regularizers, callbacks from .losses import Loss from .metrics import Metric from .model import Model from .module import Module
none
1
1.01748
1
pocean/tests/dsg/test_new.py
axiom-data-science/pocean-core
13
6625983
<gh_stars>10-100 # -*- coding: utf-8 -*- from os.path import join as jn from os.path import dirname as dn import pytest from pocean.cf import CFDataset from pocean.utils import all_subclasses from pocean.dsg import * import logging from pocean import logger logger.level = logging.INFO logger.handlers = [logging.Stre...
# -*- coding: utf-8 -*- from os.path import join as jn from os.path import dirname as dn import pytest from pocean.cf import CFDataset from pocean.utils import all_subclasses from pocean.dsg import * import logging from pocean import logger logger.level = logging.INFO logger.handlers = [logging.StreamHandler()] @p...
en
0.239596
# -*- coding: utf-8 -*- #(IndexedRaggedTimeseries, jn(dn(__file__), 'timeseries', 'resources', 'cr-multiple.nc')), #(ContiguousRaggedTimeseries, jn(dn(__file__), 'timeseries', 'resources', 'cr-multiple.nc')),
1.816717
2
client/commands/v2/restart.py
pradeep90/pyre-check
0
6625984
<filename>client/commands/v2/restart.py # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import logging from pathlib import Path from ... import command_arguments, commands, configuration as...
<filename>client/commands/v2/restart.py # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import logging from pathlib import Path from ... import command_arguments, commands, configuration as...
en
0.946521
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # This usually means there's no server running
2.591408
3
colossalai/nn/layer/wrapper/lambda_wrapper.py
RichardoLuo/ColossalAI
1,630
6625985
<filename>colossalai/nn/layer/wrapper/lambda_wrapper.py<gh_stars>1000+ #!/usr/bin/env python # -*- encoding: utf-8 -*- import torch.nn as nn from colossalai.builder import build_layer from colossalai.registry import LAYERS @LAYERS.register_module class LambdaWrapper(nn.Module): """Wrap a function to nn.Module, ...
<filename>colossalai/nn/layer/wrapper/lambda_wrapper.py<gh_stars>1000+ #!/usr/bin/env python # -*- encoding: utf-8 -*- import torch.nn as nn from colossalai.builder import build_layer from colossalai.registry import LAYERS @LAYERS.register_module class LambdaWrapper(nn.Module): """Wrap a function to nn.Module, ...
en
0.71427
#!/usr/bin/env python # -*- encoding: utf-8 -*- Wrap a function to nn.Module, which takes a config of layers and can fully access them. Args: func (``Callable``): User customed function. layers_cfg (dict, optional): Config of layers, defaults to None.
2.302575
2
ubivar/test/resources/test_event_last_id.py
oriskami/oriskami-python
4
6625986
import os import ubivar import warnings from ubivar.test.helper import (UbivarTestCase) class UbivarAPIResourcesTests(UbivarTestCase): def test_event_last_id_list(self): response = ubivar.EventLastId.list() self.assertEqual(len(response.data), 1) lastId = response.data[0]["id"] sel...
import os import ubivar import warnings from ubivar.test.helper import (UbivarTestCase) class UbivarAPIResourcesTests(UbivarTestCase): def test_event_last_id_list(self): response = ubivar.EventLastId.list() self.assertEqual(len(response.data), 1) lastId = response.data[0]["id"] sel...
none
1
2.665706
3
sdk/python/pulumi_aws/neptune/cluster_instance.py
johnktims/pulumi-aws
0
6625987
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import json import warnings import pulumi import pulumi.runtime from typing import Union from .. import utilities, tables class Cluste...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import json import warnings import pulumi import pulumi.runtime from typing import Union from .. import utilities, tables class Cluste...
en
0.657589
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** The hostname of the instance. See also `endpoint` and `port`. Specifies whether any instance modifications are applied immediately, ...
1.815458
2
telemetry/telemetry/internal/backends/chrome/fuchsia_browser_finder.py
Martijnve23/catapult
1,894
6625988
<reponame>Martijnve23/catapult<filename>telemetry/telemetry/internal/backends/chrome/fuchsia_browser_finder.py # Copyright 2019 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Finds Fuchsia browsers that can be started a...
# Copyright 2019 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Finds Fuchsia browsers that can be started and controlled by telemetry.""" from __future__ import absolute_import import os import platform from telemetr...
en
0.869057
# Copyright 2019 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. Finds Fuchsia browsers that can be started and controlled by telemetry. # pylint: disable=protected-access # Like CrOS, there's no way to automatically determ...
1.948555
2
Django/comments/models.py
xuhaer/FlaskWeb
0
6625989
<reponame>xuhaer/FlaskWeb from django.db import models # Create your models here. class Comment(models.Model): name = models.CharField(max_length=100) email = models.EmailField(max_length=255, blank=True) text = models.TextField() created_at = models.DateTimeField(auto_now_add=True) article = mod...
from django.db import models # Create your models here. class Comment(models.Model): name = models.CharField(max_length=100) email = models.EmailField(max_length=255, blank=True) text = models.TextField() created_at = models.DateTimeField(auto_now_add=True) article = models.ForeignKey('blog.Artic...
en
0.963489
# Create your models here.
2.403186
2
python/import/obj/district/nagreg.py
dudung/cookbook
0
6625990
<filename>python/import/obj/district/nagreg.py level = 3 name = 'Nagreg' capital = 'Ganjarsabar' area = 49.3
<filename>python/import/obj/district/nagreg.py level = 3 name = 'Nagreg' capital = 'Ganjarsabar' area = 49.3
none
1
1.266746
1
algorithms/GEM/GEM_main.py
YangLiangwei/DGFraud
447
6625991
''' This code is due to <NAME> (@yutongD), <NAME> (@YingtongDou) and UIC BDSC Lab DGFraud (A Deep Graph-based Toolbox for Fraud Detection) https://github.com/safe-graph/DGFraud ''' import tensorflow as tf import argparse import os import sys sys.path.insert(0, os.path.abspath(os.path.join(os.getcwd(), '../..'))) from a...
''' This code is due to <NAME> (@yutongD), <NAME> (@YingtongDou) and UIC BDSC Lab DGFraud (A Deep Graph-based Toolbox for Fraud Detection) https://github.com/safe-graph/DGFraud ''' import tensorflow as tf import argparse import os import sys sys.path.insert(0, os.path.abspath(os.path.join(os.getcwd(), '../..'))) from a...
en
0.708114
This code is due to <NAME> (@yutongD), <NAME> (@YingtongDou) and UIC BDSC Lab DGFraud (A Deep Graph-based Toolbox for Fraud Detection) https://github.com/safe-graph/DGFraud # os.environ['CUDA_VISIBLE_DEVICES'] = '0,1' # init the common args, expect the model specific args # GEM # get batch data # device num # net.load(...
2.267005
2
dataworkspace/dataworkspace/apps/core/migrations/0008_newslettersubscription.py
uktrade/analysis-workspace
1
6625992
<filename>dataworkspace/dataworkspace/apps/core/migrations/0008_newslettersubscription.py # Generated by Django 3.2.13 on 2022-05-26 13:39 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ mi...
<filename>dataworkspace/dataworkspace/apps/core/migrations/0008_newslettersubscription.py # Generated by Django 3.2.13 on 2022-05-26 13:39 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ mi...
en
0.813077
# Generated by Django 3.2.13 on 2022-05-26 13:39
1.564085
2
mail/migrations/0012_auto_20210627_1049.py
prabin-acharya/mail-Gmail
1
6625993
# Generated by Django 3.2.4 on 2021-06-27 05:04 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('mail', '0011_alter_email_subject'), ] operations = [ migrations.AddField( model_name='email', name='recipients_email...
# Generated by Django 3.2.4 on 2021-06-27 05:04 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('mail', '0011_alter_email_subject'), ] operations = [ migrations.AddField( model_name='email', name='recipients_email...
en
0.875375
# Generated by Django 3.2.4 on 2021-06-27 05:04
1.568998
2
app/core/models.py
duks500/recipe-app-api
0
6625994
import uuid import os from django.db import models # what we need to extand the user base model from django.contrib.auth.models import AbstractBaseUser, BaseUserManager, \ PermissionsMixin from django.conf import settings def recipe_image_file_path(instance, filename): """G...
import uuid import os from django.db import models # what we need to extand the user base model from django.contrib.auth.models import AbstractBaseUser, BaseUserManager, \ PermissionsMixin from django.conf import settings def recipe_image_file_path(instance, filename): """G...
en
0.872428
# what we need to extand the user base model Generate file path for new recipe image # Return the extention of the file name # Create a new name using the uuid # A relable method that allowed us to join 2 strings into a vaild path # extends the BaseUserManager # Helo manage user and superuser Create and save a new user...
2.791622
3
RecoTracker/IterativeTracking/python/PixelPairStep_cff.py
pasmuss/cmssw
0
6625995
import FWCore.ParameterSet.Config as cms from Configuration.Eras.Modifier_tracker_apv_vfp30_2016_cff import tracker_apv_vfp30_2016 as _tracker_apv_vfp30_2016 import RecoTracker.IterativeTracking.iterativeTkConfig as _cfg # NEW CLUSTERS (remove previously used clusters) pixelPairStepClusters = _cfg.clusterRemoverForIte...
import FWCore.ParameterSet.Config as cms from Configuration.Eras.Modifier_tracker_apv_vfp30_2016_cff import tracker_apv_vfp30_2016 as _tracker_apv_vfp30_2016 import RecoTracker.IterativeTracking.iterativeTkConfig as _cfg # NEW CLUSTERS (remove previously used clusters) pixelPairStepClusters = _cfg.clusterRemoverForIte...
en
0.838553
# NEW CLUSTERS (remove previously used clusters) # SEEDING LAYERS # layers covering the region not covered by quadruplets (so it is # just acting as backup of triplets) # only layers covering the region not covered by quadruplets # (so it is just acting as backup of triplets) # modifing these errors seems to make no di...
1.372906
1
lesson_planner/migrations/0027_auto_20200816_2057.py
Hogwarts250/lesson-discussion
0
6625996
<filename>lesson_planner/migrations/0027_auto_20200816_2057.py<gh_stars>0 # Generated by Django 3.1 on 2020-08-17 03:57 from django.db import migrations import django.utils.timezone import model_utils.fields class Migration(migrations.Migration): dependencies = [ ('lesson_planner', '0026_auto_20200816_1...
<filename>lesson_planner/migrations/0027_auto_20200816_2057.py<gh_stars>0 # Generated by Django 3.1 on 2020-08-17 03:57 from django.db import migrations import django.utils.timezone import model_utils.fields class Migration(migrations.Migration): dependencies = [ ('lesson_planner', '0026_auto_20200816_1...
en
0.753023
# Generated by Django 3.1 on 2020-08-17 03:57
1.538326
2
teatime/plugins/eth1/network.py
dmuhs/toaster
87
6625997
<filename>teatime/plugins/eth1/network.py """This module contains a plugin for network-related checks.""" from teatime.plugins import Context, JSONRPCPlugin, NodeType from teatime.reporting import Issue, Severity class NetworkListening(JSONRPCPlugin): """Check whether the node is listening for peers. Severi...
<filename>teatime/plugins/eth1/network.py """This module contains a plugin for network-related checks.""" from teatime.plugins import Context, JSONRPCPlugin, NodeType from teatime.reporting import Issue, Severity class NetworkListening(JSONRPCPlugin): """Check whether the node is listening for peers. Severi...
en
0.846335
This module contains a plugin for network-related checks. Check whether the node is listening for peers. Severity: High This plugin will use the :code:`net_listening` method to check whether the node is listening to new peers. If that is not the case, an issue will be logged. # SCAN[HIGH]: Node not li...
2.686689
3
ehome/libs/yuntongxun/xmltojson.py
gavinliu4011/eHome
4
6625998
<gh_stars>1-10 # -*- coding: utf-8 -*- # python xml.etree.ElementTree import os import xml.etree.ElementTree as ET from xml.dom import minidom class xmltojson: # global var # show log SHOW_LOG = True # XML file XML_PATH = None a = {} m = [] def get_root(self, path): '''parse ...
# -*- coding: utf-8 -*- # python xml.etree.ElementTree import os import xml.etree.ElementTree as ET from xml.dom import minidom class xmltojson: # global var # show log SHOW_LOG = True # XML file XML_PATH = None a = {} m = [] def get_root(self, path): '''parse the XML file,an...
en
0.510416
# -*- coding: utf-8 -*- # python xml.etree.ElementTree # global var # show log # XML file parse the XML file,and get the tree of the XML file finally,return the root element of the tree. if the XML file dose not exist,then print the information # if os.path.exists(path): # if SHOW_LOG: # print('start to...
3.446829
3
grr/server/grr_response_server/aff4_objects/standard.py
dekoder/grr
3
6625999
#!/usr/bin/env python """These are standard aff4 objects.""" from __future__ import division from __future__ import unicode_literals import io from builtins import range # pylint: disable=redefined-builtin from future.utils import iteritems from future.utils import itervalues from grr_response_core.lib import rdfv...
#!/usr/bin/env python """These are standard aff4 objects.""" from __future__ import division from __future__ import unicode_literals import io from builtins import range # pylint: disable=redefined-builtin from future.utils import iteritems from future.utils import itervalues from grr_response_core.lib import rdfv...
en
0.89946
#!/usr/bin/env python These are standard aff4 objects. # pylint: disable=redefined-builtin This represents a directory from the client. # We contain other objects within the tree. Refresh an old attribute. Note that refreshing the attribute is asynchronous. It does not change anything about the current object ...
1.915063
2
KM.py
ziranl16/UROP_KMTE
1
6626000
<reponame>ziranl16/UROP_KMTE import json import numpy as np import pandas as pd import matplotlib.pyplot as plt from lifelines import KaplanMeierFitter YEARMIN = -50 YEARMAX = 3000 # Useful for printing plots in Jupyter # calculate survival function for worksAt def survival_find_0(filename): r = "3" triple...
import json import numpy as np import pandas as pd import matplotlib.pyplot as plt from lifelines import KaplanMeierFitter YEARMIN = -50 YEARMAX = 3000 # Useful for printing plots in Jupyter # calculate survival function for worksAt def survival_find_0(filename): r = "3" triple_time = np.array([[0, 0]]) ...
en
0.652783
# Useful for printing plots in Jupyter # calculate survival function for worksAt ###': ###':
3.406482
3
nest_box_helper/admin.py
natalieehaas/nestboxhelper
0
6626001
from django.contrib import admin from nest_box_helper.models import Account, Sheet, Park, Box, Attempt, UserParks admin.site.register(Account) admin.site.register(Sheet) admin.site.register(Park) admin.site.register(Box) admin.site.register(Attempt) admin.site.register(UserParks)
from django.contrib import admin from nest_box_helper.models import Account, Sheet, Park, Box, Attempt, UserParks admin.site.register(Account) admin.site.register(Sheet) admin.site.register(Park) admin.site.register(Box) admin.site.register(Attempt) admin.site.register(UserParks)
none
1
1.426636
1
archive/scripts/classify_sleep.py
marta18a/sleep_classifiers
3
6626002
import numpy as np import warnings import time import matplotlib.pyplot as plt import seaborn as sns import matplotlib.font_manager as font_manager import matplotlib.cbook from sklearn.ensemble import RandomForestClassifier from sklearn.linear_model import LogisticRegression from sklearn.neural_network import MLPClas...
import numpy as np import warnings import time import matplotlib.pyplot as plt import seaborn as sns import matplotlib.font_manager as font_manager import matplotlib.cbook from sklearn.ensemble import RandomForestClassifier from sklearn.linear_model import LogisticRegression from sklearn.neural_network import MLPClas...
en
0.778967
# Load params saved from file # Print LaTeX table for paper # REM Binary search parameters # How close we have to be to the desired goal FP before it can be added to the average # Number of times to try before quitting the binary search # How close we want NREM and REM accuracies to be # Constants for plotting and tabl...
2.252253
2
eggshell/nc/nc_fetch.py
Zeitsperre/eggshell
0
6626003
from eggshell import utils from eggshell import config from datetime import datetime as dt from datetime import timedelta # import logging # logger = logging.getLogger(__name__) import logging LOGGER = logging.getLogger("PYWPS") _PRESSUREDATA_ = [ 'NCEP_slp', 'NCEP_z1000', 'NCEP_z925', 'NCEP_z850', 'NCEP_z700', ...
from eggshell import utils from eggshell import config from datetime import datetime as dt from datetime import timedelta # import logging # logger = logging.getLogger(__name__) import logging LOGGER = logging.getLogger("PYWPS") _PRESSUREDATA_ = [ 'NCEP_slp', 'NCEP_z1000', 'NCEP_z925', 'NCEP_z850', 'NCEP_z700', ...
en
0.54999
# import logging # logger = logging.getLogger(__name__) Fetches the reanalysis data (NCEP, 20CR or ERA_20C) to local file system :param start: int for start year to fetch source data :param end: int for end year to fetch source data (if None, current year will be the end) :param variable: variable name (de...
2.025341
2
mutual_library/models/mutual_diary_user.py
mubuca95/mutual_diary
0
6626004
<reponame>mubuca95/mutual_diary import mysql.connector from mysql.connector import errorcode from sqlalchemy.sql.schema import ForeignKey from db import db class mutual_diary_user(db.Model): __tablename__ = 'mutual_diary_user' iduser = db.Column(db.Integer, foreign_key = True) iddiary = db.Column(d...
import mysql.connector from mysql.connector import errorcode from sqlalchemy.sql.schema import ForeignKey from db import db class mutual_diary_user(db.Model): __tablename__ = 'mutual_diary_user' iduser = db.Column(db.Integer, foreign_key = True) iddiary = db.Column(db.Integer, foreign_key = True) ...
none
1
2.502166
3
lib/dataset/transforms/build.py
ankhzaya/HigherHRNet-Human-Pose-Estimation
775
6626005
# ------------------------------------------------------------------------------ # Copyright (c) Microsoft # Licensed under the MIT License. # Written by <NAME> (<EMAIL>) # Modified by <NAME> (<EMAIL>) # ------------------------------------------------------------------------------ from __future__ import absolute_impo...
# ------------------------------------------------------------------------------ # Copyright (c) Microsoft # Licensed under the MIT License. # Written by <NAME> (<EMAIL>) # Modified by <NAME> (<EMAIL>) # ------------------------------------------------------------------------------ from __future__ import absolute_impo...
en
0.335606
# ------------------------------------------------------------------------------ # Copyright (c) Microsoft # Licensed under the MIT License. # Written by <NAME> (<EMAIL>) # Modified by <NAME> (<EMAIL>) # ------------------------------------------------------------------------------ # coco_flip_index = [0, 2, 1, 4, 3, 6...
2.135575
2
application/models/inventory/brand.py
mutalisk999/bibi
1,037
6626006
<filename>application/models/inventory/brand.py # -*- coding: utf-8 -*- from application.extensions import db __all__ = ['Brand'] class Brand(db.Document): meta = { 'db_alias': 'inventory_db', 'indexes': ['en'] } en = db.StringField(required=True, unique=True) cn = db.StringField() ...
<filename>application/models/inventory/brand.py # -*- coding: utf-8 -*- from application.extensions import db __all__ = ['Brand'] class Brand(db.Document): meta = { 'db_alias': 'inventory_db', 'indexes': ['en'] } en = db.StringField(required=True, unique=True) cn = db.StringField() ...
en
0.769321
# -*- coding: utf-8 -*-
2.252218
2
kittycad/models/engine_metadata.py
KittyCAD/kittycad.py
1
6626007
<filename>kittycad/models/engine_metadata.py from typing import Any, Dict, List, Type, TypeVar, Union, cast import attr from ..models.file_system_metadata import FileSystemMetadata from ..models.nats_connection import NatsConnection from ..types import UNSET, Unset T = TypeVar("T", bound="EngineMetadata") @attr.s(...
<filename>kittycad/models/engine_metadata.py from typing import Any, Dict, List, Type, TypeVar, Union, cast import attr from ..models.file_system_metadata import FileSystemMetadata from ..models.nats_connection import NatsConnection from ..types import UNSET, Unset T = TypeVar("T", bound="EngineMetadata") @attr.s(...
none
1
1.95969
2
genmotion/render/c4d/params.py
yizhouzhao/GenMotion
32
6626008
<filename>genmotion/render/c4d/params.py # Get skeleton information from https://meshcapade.wiki/SMPL#smpl-x SMPL_SKELETON = { 0: 'Pelvis', 3: 'Spine1', 6: 'Spine2', 9: 'Spine3', 12: 'Neck', 15: 'Head', 1: 'L_Hip', 4: 'L_Knee', 7: 'L_Ankle', 10: 'L_Foot', 2: 'R_Hip', 5...
<filename>genmotion/render/c4d/params.py # Get skeleton information from https://meshcapade.wiki/SMPL#smpl-x SMPL_SKELETON = { 0: 'Pelvis', 3: 'Spine1', 6: 'Spine2', 9: 'Spine3', 12: 'Neck', 15: 'Head', 1: 'L_Hip', 4: 'L_Knee', 7: 'L_Ankle', 10: 'L_Foot', 2: 'R_Hip', 5...
en
0.374059
# Get skeleton information from https://meshcapade.wiki/SMPL#smpl-x
1.829999
2
7 term/Local-Computer-Networks-System-Software/Lab 4/shared/errors/disconnected_exception.py
Vanya112/BSUIR_Labs
24
6626009
class DisconnectedException(Exception): pass
class DisconnectedException(Exception): pass
none
1
0.995239
1
rllib/examples/centralized_critic_2.py
77loopin/ray
21,382
6626010
"""An example of implementing a centralized critic with ObservationFunction. The advantage of this approach is that it's very simple and you don't have to change the algorithm at all -- just use callbacks and a custom model. However, it is a bit less principled in that you have to change the agent observation spaces t...
"""An example of implementing a centralized critic with ObservationFunction. The advantage of this approach is that it's very simple and you don't have to change the algorithm at all -- just use callbacks and a custom model. However, it is a bit less principled in that you have to change the agent observation spaces t...
en
0.94022
An example of implementing a centralized critic with ObservationFunction. The advantage of this approach is that it's very simple and you don't have to change the algorithm at all -- just use callbacks and a custom model. However, it is a bit less principled in that you have to change the agent observation spaces to i...
2.900671
3
Tests/test_dict.py
hackf5/ironpython3
0
6626011
# Licensed to the .NET Foundation under one or more agreements. # The .NET Foundation licenses this file to you under the Apache 2.0 License. # See the LICENSE file in the project root for more information. #Regression: CodePlex 15715 #Do not move or remove these two lines x = dir(dict) x = dir(dict.fromkeys) import ...
# Licensed to the .NET Foundation under one or more agreements. # The .NET Foundation licenses this file to you under the Apache 2.0 License. # See the LICENSE file in the project root for more information. #Regression: CodePlex 15715 #Do not move or remove these two lines x = dir(dict) x = dir(dict.fromkeys) import ...
en
0.724389
# Licensed to the .NET Foundation under one or more agreements. # The .NET Foundation licenses this file to you under the Apache 2.0 License. # See the LICENSE file in the project root for more information. #Regression: CodePlex 15715 #Do not move or remove these two lines # TODO: remove assertRaises when https://githu...
2.134592
2
hooks/tk-multi-setframerange/frame_operations_tk-rumba.py
diegogarciahuerta/tk-rumba
0
6626012
<gh_stars>0 # ---------------------------------------------------------------------------- # Copyright (c) 2021, <NAME>. # # Your use of this software as distributed in this GitHub repository, is # governed by the MIT License # # Your use of the Shotgun Pipeline Toolkit is governed by the applicable # license agreement...
# ---------------------------------------------------------------------------- # Copyright (c) 2021, <NAME>. # # Your use of this software as distributed in this GitHub repository, is # governed by the MIT License # # Your use of the Shotgun Pipeline Toolkit is governed by the applicable # license agreement between you...
en
0.675689
# ---------------------------------------------------------------------------- # Copyright (c) 2021, <NAME>. # # Your use of this software as distributed in this GitHub repository, is # governed by the MIT License # # Your use of the Shotgun Pipeline Toolkit is governed by the applicable # license agreement between you...
2.327222
2
splink/default_settings.py
slobo/splink
176
6626013
import warnings from pyspark.sql.session import SparkSession from copy import deepcopy from .validate import get_default_value_from_schema from .case_statements import ( _check_jaro_registered, sql_gen_case_smnt_strict_equality_2, sql_gen_case_stmt_levenshtein_rel_3, sql_gen_case_stmt_levenshtein_re...
import warnings from pyspark.sql.session import SparkSession from copy import deepcopy from .validate import get_default_value_from_schema from .case_statements import ( _check_jaro_registered, sql_gen_case_smnt_strict_equality_2, sql_gen_case_stmt_levenshtein_rel_3, sql_gen_case_stmt_levenshtein_re...
en
0.696327
# Note all m and u probabilities are automatically normalised to sum to 1 Args: col_settings (dict): Column settings dictionary mu_probabilities (str): Either 'm_probabilities' or 'u_probabilities' Auto-populate any missing settings from the settings dictionary using the 'sensible defaults' that are...
2.111751
2
maintenance/models/maintenance.py
prorevizor/noc
0
6626014
# --------------------------------------------------------------------- # Maintenance # --------------------------------------------------------------------- # Copyright (C) 2007-2020 The NOC Project # See LICENSE for details # --------------------------------------------------------------------- # Python import datet...
# --------------------------------------------------------------------- # Maintenance # --------------------------------------------------------------------- # Copyright (C) 2007-2020 The NOC Project # See LICENSE for details # --------------------------------------------------------------------- # Python import datet...
en
0.712051
# --------------------------------------------------------------------- # Maintenance # --------------------------------------------------------------------- # Copyright (C) 2007-2020 The NOC Project # See LICENSE for details # --------------------------------------------------------------------- # Python # Third-party...
1.70509
2
jp.atcoder/abc114/abc114_a/8393448.py
kagemeka/atcoder-submissions
1
6626015
<gh_stars>1-10 # 2019-11-11 16:07:35(JST) import sys # import collections # import math # from string import ascii_lowercase, ascii_uppercase, digits # from bisect import bisect_left as bi_l, bisect_right as bi_r # import itertools # from functools import reduce # import operator as op # from scipy.misc impo...
# 2019-11-11 16:07:35(JST) import sys # import collections # import math # from string import ascii_lowercase, ascii_uppercase, digits # from bisect import bisect_left as bi_l, bisect_right as bi_r # import itertools # from functools import reduce # import operator as op # from scipy.misc import comb # float...
en
0.626924
# 2019-11-11 16:07:35(JST) # import collections # import math # from string import ascii_lowercase, ascii_uppercase, digits # from bisect import bisect_left as bi_l, bisect_right as bi_r # import itertools # from functools import reduce # import operator as op # from scipy.misc import comb # float # import numpy as np
2.710578
3
Ui_QTDialogVer2.py
PRJJOHN/Automation
0
6626016
<reponame>PRJJOHN/Automation # -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'd:\biologue\Automation\QTDialogVer2.ui' # # Created by: PyQt5 UI code generator 5.15.4 # # WARNING: Any manual changes made to this file will be lost when pyuic5 is # run again. Do not edit this file unless you ...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'd:\biologue\Automation\QTDialogVer2.ui' # # Created by: PyQt5 UI code generator 5.15.4 # # WARNING: Any manual changes made to this file will be lost when pyuic5 is # run again. Do not edit this file unless you know what you are doing. fr...
en
0.840786
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'd:\biologue\Automation\QTDialogVer2.ui' # # Created by: PyQt5 UI code generator 5.15.4 # # WARNING: Any manual changes made to this file will be lost when pyuic5 is # run again. Do not edit this file unless you know what you are doing.
2.168651
2
python/ua_gec/stats.py
kaidisn/ua-gec
0
6626017
<reponame>kaidisn/ua-gec<filename>python/ua_gec/stats.py #!/usr/bin/env python3 import spacy class CorpusStatistics: """Compute corpus statistics. """ def __init__(self, corpus): self.corpus = corpus self.stats = {} self.nlp = spacy.load("xx_ent_wiki_sm") self.compute() d...
#!/usr/bin/env python3 import spacy class CorpusStatistics: """Compute corpus statistics. """ def __init__(self, corpus): self.corpus = corpus self.stats = {} self.nlp = spacy.load("xx_ent_wiki_sm") self.compute() def compute(self): docs = corpus.get_documents() ...
en
0.607374
#!/usr/bin/env python3 Compute corpus statistics. Compute statistics with breakdown by `field`. Returns: dict: field_class (str) => stats (dict[str, int])
2.752972
3
liteasr/nets/feed_forward.py
Nazukixv/LiteASR
0
6626018
<gh_stars>0 import torch.nn as nn class PositionwiseFeedForward(nn.Module): def __init__( self, i_dim: int, h_units: int, dropout_rate: float, activation: nn.Module = nn.ReLU(), ): super().__init__() self.fc1 = nn.Linear(i_dim, h_units) self.fc2...
import torch.nn as nn class PositionwiseFeedForward(nn.Module): def __init__( self, i_dim: int, h_units: int, dropout_rate: float, activation: nn.Module = nn.ReLU(), ): super().__init__() self.fc1 = nn.Linear(i_dim, h_units) self.fc2 = nn.Linear...
none
1
2.921392
3
man_knife_ssl_check/source/conf.py
iennae/chef-docs
0
6626019
<filename>man_knife_ssl_check/source/conf.py # -*- coding: utf-8 -*- # # Chef documentation build configuration file, created by # sphinx-quickstart on Wed Feb 22 13:50:49 2012. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; val...
<filename>man_knife_ssl_check/source/conf.py # -*- coding: utf-8 -*- # # Chef documentation build configuration file, created by # sphinx-quickstart on Wed Feb 22 13:50:49 2012. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; val...
en
0.72064
# -*- coding: utf-8 -*- # # Chef documentation build configuration file, created by # sphinx-quickstart on Wed Feb 22 13:50:49 2012. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show th...
1.532711
2
dimka/core/app.py
madmis/dimka-binance
0
6626020
import argparse import time import logging import os from binance.client import Client from dimka.core import config, models class Application: """ BitBot Application instance """ def __init__(self, bot_name: str): self.bot_name = bot_name self.__init_default_arguments() self.config...
import argparse import time import logging import os from binance.client import Client from dimka.core import config, models class Application: """ BitBot Application instance """ def __init__(self, bot_name: str): self.bot_name = bot_name self.__init_default_arguments() self.config...
en
0.416428
BitBot Application instance Add application console argument. Can be used to add specific bot arguments. Parse application config Initialize application logger Initialize database Initialize ArgumentParser and set default arguments Exception to restart loop with bot.run
2.265196
2
blog/forms.py
arminadm/django_projects
0
6626021
<filename>blog/forms.py from django import forms from blog.models import Comment from captcha.fields import CaptchaField class commentForm(forms.ModelForm): captcha = CaptchaField() class Meta: model = Comment fields = ['post', 'author', 'email', 'message']
<filename>blog/forms.py from django import forms from blog.models import Comment from captcha.fields import CaptchaField class commentForm(forms.ModelForm): captcha = CaptchaField() class Meta: model = Comment fields = ['post', 'author', 'email', 'message']
none
1
2.139858
2
tests/acquisition/covid_hosp/state_timeseries/test_network.py
chinandrew/delphi-epidata
1
6626022
"""Unit tests for network.py.""" # standard library import unittest from unittest.mock import patch from unittest.mock import sentinel from delphi.epidata.acquisition.covid_hosp.state_timeseries.network import Network # py3tester coverage target __test_target__ = \ 'delphi.epidata.acquisition.covid_hosp.state_t...
"""Unit tests for network.py.""" # standard library import unittest from unittest.mock import patch from unittest.mock import sentinel from delphi.epidata.acquisition.covid_hosp.state_timeseries.network import Network # py3tester coverage target __test_target__ = \ 'delphi.epidata.acquisition.covid_hosp.state_t...
en
0.869806
Unit tests for network.py. # standard library # py3tester coverage target Fetch metadata as JSON.
2.438478
2
lncrawl/sources/wattpad.py
betabeast12/lightnovel-crawler
1
6626023
<reponame>betabeast12/lightnovel-crawler<gh_stars>1-10 # -*- coding: utf-8 -*- from time import time import logging import re from urllib.parse import urlparse from ..utils.crawler import Crawler logger = logging.getLogger(__name__) chapter_info_url = 'https://www.wattpad.com/v4/parts/%s?fields=id,title,pages,text_ur...
# -*- coding: utf-8 -*- from time import time import logging import re from urllib.parse import urlparse from ..utils.crawler import Crawler logger = logging.getLogger(__name__) chapter_info_url = 'https://www.wattpad.com/v4/parts/%s?fields=id,title,pages,text_url&_=%d' class WattpadCrawler(Crawler): base_url = ...
en
0.374887
# -*- coding: utf-8 -*- Get novel title, autor, cover etc #description = soup.select('h2.description')[0].get_text() # chapters.reverse() # end for # end def Download body of a single chapter and return as clean html format. # soup = self.get_soup(chapter['url']) # pages = int(re.search( # '[1-9]', re.search('("pag...
3.053099
3
MultiPManager/__init__.py
sebastiantrianac/SoftTLON
0
6626024
# __init__.py import sys import stomp import dill as pickle import time
# __init__.py import sys import stomp import dill as pickle import time
ar
0.447093
# __init__.py
1.005283
1
xlsxwriter/test/comparison/test_header_image01.py
haiyangd/XlsxWriter
3
6626025
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2017, <NAME>, <EMAIL> # from ..excel_comparsion_test import ExcelComparisonTest from ...workbook import Workbook from ...compatibility import BytesIO class TestCompareXLSXFiles(ExcelCompa...
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2017, <NAME>, <EMAIL> # from ..excel_comparsion_test import ExcelComparisonTest from ...workbook import Workbook from ...compatibility import BytesIO class TestCompareXLSXFiles(ExcelCompa...
en
0.64347
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2017, <NAME>, <EMAIL> # Test file created by XlsxWriter against a file created by Excel. Test the creation of a simple XlsxWriter file with image(s). Test the creation of a simple XlsxWriter...
2.745639
3
test_liteproto.py
lybicat/lite-protobuf
1
6626026
<gh_stars>1-10 from unittest import TestCase from liteproto import load from liteproto import loads class TestLiteProto(TestCase): def test_load_proto_file(self): load('ut.proto', 'Pair') def test_load_proto_string(self): loads('''syntax = "proto2"; message Ack{ enum ConfirmationStatus{ ...
from unittest import TestCase from liteproto import load from liteproto import loads class TestLiteProto(TestCase): def test_load_proto_file(self): load('ut.proto', 'Pair') def test_load_proto_string(self): loads('''syntax = "proto2"; message Ack{ enum ConfirmationStatus{ ACK = 1...
en
0.289122
syntax = "proto2"; message Ack{ enum ConfirmationStatus{ ACK = 1; NACK = 2; } required ConfirmationStatus confirmation = 1; required uint32 transactionId = 2; optional string reason = 3; }
2.463058
2
authentication/configuration.py
anae09/electionWebService
0
6626027
from datetime import timedelta import os db = os.environ["DATABASE_URL"]; class Configuration: SQLALCHEMY_DATABASE_URI = "mysql+pymysql://root:root@{}/authentication".format(db); JWT_SECRET_KEY = "ANA_ANA_ANA"; JWT_ACCESS_TOKEN_EXPIRES = timedelta(hours=1); JWT_REFRESH_TOKEN_EXPIRES = timedelta(days=...
from datetime import timedelta import os db = os.environ["DATABASE_URL"]; class Configuration: SQLALCHEMY_DATABASE_URI = "mysql+pymysql://root:root@{}/authentication".format(db); JWT_SECRET_KEY = "ANA_ANA_ANA"; JWT_ACCESS_TOKEN_EXPIRES = timedelta(hours=1); JWT_REFRESH_TOKEN_EXPIRES = timedelta(days=...
none
1
2.449218
2
Imaging/sensor.py
CHEN-yongquan/Asteroid_CPO_seeker
2
6626028
<filename>Imaging/sensor.py import numpy as np import attitude_utils as attu import matplotlib.pyplot as plt import matplotlib.patches as patches import env_utils as envu class Sensor(object): def __init__(self, seeker, max_range_intensity=0.0, attitude_parameterization=attu.Quaternion_attitude, use_range=True, ...
<filename>Imaging/sensor.py import numpy as np import attitude_utils as attu import matplotlib.pyplot as plt import matplotlib.patches as patches import env_utils as envu class Sensor(object): def __init__(self, seeker, max_range_intensity=0.0, attitude_parameterization=attu.Quaternion_attitude, use_range=True, ...
en
0.614396
#self.c_dvec = None #pixel_int = np.squeeze(pixel_int) #print('sensor: ', pixel_int, np.linalg.norm(agent_location)) #print('PC2: ', seeker_angles, self.last_seeker_angles) #if self.fov_violation: # print(state) # assert False #print(state) #print(state) #print(state) A fast implementation of the forward pass for...
2.565557
3
openmdao/components/eq_constraint_comp.py
sebasgo/OpenMDAO
0
6626029
"""Define the EQConstraintComp class.""" from numbers import Number import numpy as np from openmdao.core.explicitcomponent import ExplicitComponent from openmdao.utils import cs_safe class EQConstraintComp(ExplicitComponent): """ A component that computes the difference between two inputs to test for equa...
"""Define the EQConstraintComp class.""" from numbers import Number import numpy as np from openmdao.core.explicitcomponent import ExplicitComponent from openmdao.utils import cs_safe class EQConstraintComp(ExplicitComponent): """ A component that computes the difference between two inputs to test for equa...
en
0.67768
Define the EQConstraintComp class. A component that computes the difference between two inputs to test for equality. Attributes ---------- _output_vars : dict Cache the data provided during `add_eq_output` so everything can be saved until setup is called. Initialize an EQConstraintComp, opt...
2.970779
3
exercicios/Lista5/Q7.py
AlexandrePeBrito/CursoUdemyPython
0
6626030
<gh_stars>0 #7. Faça uma função que receba uma temperatura em graus Celsius e retorne-a convertida #em graus Fahrenheit. A fórmula de conversão é: F = C + (9.0/5.0) + 32.0, sendo F a #temperatura em Fahrenheit e C' a temperatura em Celsius. def convertCF(temp): return temp+(9/5)+32 valor=float(input("Informe a te...
#7. Faça uma função que receba uma temperatura em graus Celsius e retorne-a convertida #em graus Fahrenheit. A fórmula de conversão é: F = C + (9.0/5.0) + 32.0, sendo F a #temperatura em Fahrenheit e C' a temperatura em Celsius. def convertCF(temp): return temp+(9/5)+32 valor=float(input("Informe a temperatura em...
pt
0.974808
#7. Faça uma função que receba uma temperatura em graus Celsius e retorne-a convertida #em graus Fahrenheit. A fórmula de conversão é: F = C + (9.0/5.0) + 32.0, sendo F a #temperatura em Fahrenheit e C' a temperatura em Celsius.
4.10781
4
cssTkinter/html_processor.py
rug-gui/cssTk
4
6626031
def fail(): raise RuntimeError() def parse_html(html): from bs4 import BeautifulSoup b=BeautifulSoup(html, "html.parser") if not b: fail() if not len(b.select("html"))==1: fail() return b
def fail(): raise RuntimeError() def parse_html(html): from bs4 import BeautifulSoup b=BeautifulSoup(html, "html.parser") if not b: fail() if not len(b.select("html"))==1: fail() return b
none
1
3.120721
3
tools/get_pr_ut.py
a6802739/Paddle
2
6626032
<filename>tools/get_pr_ut.py # Copyright (c) 2020 PaddlePaddle 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...
<filename>tools/get_pr_ut.py # Copyright (c) 2020 PaddlePaddle 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...
en
0.714033
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
2.395192
2
CircuitPython_Made_Easy_On_CPX/cpx_play_file_buttons/code.py
albinger/Adafruit_Learning_System_Guides
0
6626033
# SPDX-FileCopyrightText: 2017 <NAME> for Adafruit Industries # # SPDX-License-Identifier: MIT from adafruit_circuitplayground.express import cpx while True: if cpx.button_a: cpx.play_file("Wild_Eep.wav") if cpx.button_b: cpx.play_file("Coin.wav")
# SPDX-FileCopyrightText: 2017 <NAME> for Adafruit Industries # # SPDX-License-Identifier: MIT from adafruit_circuitplayground.express import cpx while True: if cpx.button_a: cpx.play_file("Wild_Eep.wav") if cpx.button_b: cpx.play_file("Coin.wav")
en
0.293691
# SPDX-FileCopyrightText: 2017 <NAME> for Adafruit Industries # # SPDX-License-Identifier: MIT
2.225828
2
test.py
ACkuku/mx-rcnn
0
6626034
import argparse import ast import pprint import mxnet as mx from mxnet.module import Module import numpy as np from tqdm import tqdm from symdata.bbox import im_detect from symdata.loader import TestLoader from symnet.logger import logger from symnet.model import load_param, check_shape def test_net(sym, imdb, args...
import argparse import ast import pprint import mxnet as mx from mxnet.module import Module import numpy as np from tqdm import tqdm from symdata.bbox import im_detect from symdata.loader import TestLoader from symnet.logger import logger from symnet.model import load_param, check_shape def test_net(sym, imdb, args...
en
0.596236
# print config # setup context # load testing data # load params # produce shape max possible # check shapes # create and bind module # all detections are collected into: # all_boxes[cls][image] = N x 5 array of detections in # (x1, y1, x2, y2, score) # start detection # forward # evaluate model # faster rcnn par...
2.06621
2
SOLID LAB/02_OCP/animal.py
borko81/SU_OOP_2021
0
6626035
<reponame>borko81/SU_OOP_2021 from abc import ABC, abstractmethod class SomeAnimal(ABC): @abstractmethod def __repr__(self): pass class Cat(SomeAnimal): def __repr__(self): return "meow" class Dog(SomeAnimal): def __repr__(self): return "wolf-wolf" class Animal: def _...
from abc import ABC, abstractmethod class SomeAnimal(ABC): @abstractmethod def __repr__(self): pass class Cat(SomeAnimal): def __repr__(self): return "meow" class Dog(SomeAnimal): def __repr__(self): return "wolf-wolf" class Animal: def __init__(self, species): ...
none
1
3.918344
4
qa/L0_lifecycle/lifecycle_test.py
kpedro88/triton-inference-server
0
6626036
<filename>qa/L0_lifecycle/lifecycle_test.py<gh_stars>0 # Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # * Redistributions of source code must retai...
<filename>qa/L0_lifecycle/lifecycle_test.py<gh_stars>0 # Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # * Redistributions of source code must retai...
en
0.890584
# Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditi...
1.525813
2
rlbox/rand/sampler.py
ocraft/rl-sandbox
2
6626037
<gh_stars>1-10 import itertools import numpy as np SAMPLER_CACHE = 10000 def cache_gen(source): values = source() while True: for value in values: yield value values = source() class Sampler: """Provides precomputed random samples of various distribution.""" randn_gen...
import itertools import numpy as np SAMPLER_CACHE = 10000 def cache_gen(source): values = source() while True: for value in values: yield value values = source() class Sampler: """Provides precomputed random samples of various distribution.""" randn_gen = cache_gen(la...
en
0.873309
Provides precomputed random samples of various distribution.
3.081449
3
mars/tensor/expressions/fuse/core.py
lmatz/mars
1
6626038
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 1999-2018 Alibaba Group Holding Ltd. # # 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-...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 1999-2018 Alibaba Group Holding Ltd. # # 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-...
en
0.820834
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 1999-2018 Alibaba Group Holding Ltd. # # 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.08458
2
sqlite_dbint/field_formatter.py
acollu/sqlite_dbint
0
6626039
from .errors import InvalidConditionFormat, InvalidConditionSequence, InvalidLogicalOperator, InvalidComparisonMember, InvalidConditionalOperator class FieldFormatter: comparison_operators = ["=", "<>", ">", "<", ">=", "<="] # equal, not equal, higher, lower, higher equal, lower equal logical_operators = ["AN...
from .errors import InvalidConditionFormat, InvalidConditionSequence, InvalidLogicalOperator, InvalidComparisonMember, InvalidConditionalOperator class FieldFormatter: comparison_operators = ["=", "<>", ">", "<", ">=", "<="] # equal, not equal, higher, lower, higher equal, lower equal logical_operators = ["AN...
en
0.757168
# equal, not equal, higher, lower, higher equal, lower equal
2.901255
3
bot/utils/paginator.py
fwizpy/Tortoise-BOT
1
6626040
from typing import List, Union from asyncio import TimeoutError from discord.abc import Messageable from discord import ClientUser, User, Member, HTTPException from discord.ext import commands from bot.utils.embed_handler import info class Paginator: ARROW_TO_BEGINNING = "⏪" ARROW_BACKWARD = "◀" ARROW_F...
from typing import List, Union from asyncio import TimeoutError from discord.abc import Messageable from discord import ClientUser, User, Member, HTTPException from discord.ext import commands from bot.utils.embed_handler import info class Paginator: ARROW_TO_BEGINNING = "⏪" ARROW_BACKWARD = "◀" ARROW_F...
en
0.819126
:param page_size: Maximum page string size for the page content. :param separator: Separator used to break large chunks of content to smaller ones, if needed. :param timeout: How long will the reactions be awaited for. :param prefix: Prefix for the message content. :param suffix: Suffix ...
2.846509
3
tasks/Scrapy/scrapy_official_newspapers/spiders/mexicoDOF.py
rongfang323/policy-data-analyzer
0
6626041
<filename>tasks/Scrapy/scrapy_official_newspapers/spiders/mexicoDOF.py from scrapy_official_newspapers.spiders import BaseSpider from scrapy import Request from scrapy.selector import Selector from scrapy_official_newspapers.items import ScrapyOfficialNewspapersItem import time import json import re import datet...
<filename>tasks/Scrapy/scrapy_official_newspapers/spiders/mexicoDOF.py from scrapy_official_newspapers.spiders import BaseSpider from scrapy import Request from scrapy.selector import Selector from scrapy_official_newspapers.items import ScrapyOfficialNewspapersItem import time import json import re import datet...
none
1
2.712191
3
avwx/service/base.py
mralext20/avwx-engine
0
6626042
<gh_stars>0 """ Service base class """ # pylint: disable=too-few-public-methods # stdlib from socket import gaierror from typing import Any, Tuple # library import httpx import httpcore # module from avwx.exceptions import SourceError _VALUE_ERROR = "'{}' is not a valid report type for {}. Expected {}" class Ser...
""" Service base class """ # pylint: disable=too-few-public-methods # stdlib from socket import gaierror from typing import Any, Tuple # library import httpx import httpcore # module from avwx.exceptions import SourceError _VALUE_ERROR = "'{}' is not a valid report type for {}. Expected {}" class Service: ""...
en
0.748853
Service base class # pylint: disable=too-few-public-methods # stdlib # library # module Base Service class for fetching reports Fetches a report string from the service Asynchronously fetch a report string from the service Service supporting HTTP requests
2.620401
3
src/server/consts.py
theaellengo/stories
1
6626043
port = 5000 dbname = 'stories_data.db' secret_key = 'q1er16sa5f7-fdfsa'
port = 5000 dbname = 'stories_data.db' secret_key = 'q1er16sa5f7-fdfsa'
none
1
0.931772
1
setup.py
renestraub/vcu-ui
0
6626044
import setuptools from vcuui._version import __version__ as version with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name="vcu-ui", version=version, author="<NAME>", author_email="<EMAIL>", description="NG800/VCU Pro Web UI", long_description=long_descrip...
import setuptools from vcuui._version import __version__ as version with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name="vcu-ui", version=version, author="<NAME>", author_email="<EMAIL>", description="NG800/VCU Pro Web UI", long_description=long_descrip...
en
0.265382
# Use MANIFEST.in to add *.html, *.css files
1.613443
2
xy/anneal.py
mrzl/Composition37XY
67
6626045
<filename>xy/anneal.py import math import random def anneal(state, max_temp, min_temp, steps): factor = -math.log(float(max_temp) / min_temp) state = state.copy() best_state = state.copy() best_energy = state.energy() previous_energy = best_energy for step in xrange(steps): temp = max_t...
<filename>xy/anneal.py import math import random def anneal(state, max_temp, min_temp, steps): factor = -math.log(float(max_temp) / min_temp) state = state.copy() best_state = state.copy() best_energy = state.energy() previous_energy = best_energy for step in xrange(steps): temp = max_t...
en
0.473434
# print step, temp, energy
3.37938
3
04_Data Manipulation with pandas/03_Slicing and Indexing/07_Slicing time series.py
mohd-faizy/DataScience-With-Python
5
6626046
<gh_stars>1-10 ''' 07 - Slicing time series: Slicing is particularly useful for time series since it's a common thing to want to filter for data within a date range. Add the date column to the index, then use .loc[] to perform the subsetting. The important thing to remember is to keep your dates in ISO 8601 format,...
''' 07 - Slicing time series: Slicing is particularly useful for time series since it's a common thing to want to filter for data within a date range. Add the date column to the index, then use .loc[] to perform the subsetting. The important thing to remember is to keep your dates in ISO 8601 format, that is, yyyy-...
en
0.811598
07 - Slicing time series: Slicing is particularly useful for time series since it's a common thing to want to filter for data within a date range. Add the date column to the index, then use .loc[] to perform the subsetting. The important thing to remember is to keep your dates in ISO 8601 format, that is, yyyy-mm-d...
4.217638
4
fast_bert/prediction.py
BobCN2017/fast-bert
0
6626047
import logging import os import torch from transformers import BertTokenizer from .data_cls import BertDataBunch from .learner_cls import BertLearner from .modeling import ( BertForMultiLabelSequenceClassification, XLNetForMultiLabelSequenceClassification, RobertaForMultiLabelSequenceClassification, Dis...
import logging import os import torch from transformers import BertTokenizer from .data_cls import BertDataBunch from .learner_cls import BertLearner from .modeling import ( BertForMultiLabelSequenceClassification, XLNetForMultiLabelSequenceClassification, RobertaForMultiLabelSequenceClassification, Dis...
en
0.301297
# instantiate the new tokeniser object using the tokeniser name
2.169891
2
Algo and DSA/LeetCode-Solutions-master/Python/first-unique-number.py
Sourav692/FAANG-Interview-Preparation
3,269
6626048
<reponame>Sourav692/FAANG-Interview-Preparation<gh_stars>1000+ # Time: ctor: O(k) # add: O(1) # showFirstUnique: O(1) # Space: O(n) import collections class FirstUnique(object): def __init__(self, nums): """ :type nums: List[int] """ self.__q = collections.OrderedD...
# Time: ctor: O(k) # add: O(1) # showFirstUnique: O(1) # Space: O(n) import collections class FirstUnique(object): def __init__(self, nums): """ :type nums: List[int] """ self.__q = collections.OrderedDict() self.__dup = set() for num in nums: ...
en
0.385294
# Time: ctor: O(k) # add: O(1) # showFirstUnique: O(1) # Space: O(n) :type nums: List[int] :rtype: int :type value: int :rtype: None
3.588906
4
partition_wiki.py
trneedham/Spectral-Gromov-Wasserstein
13
6626049
## Script to run graph partitioning experiment on Wiki dataset # Load packages import numpy as np import networkx as nx import matplotlib.pyplot as plt import matplotlib import time import ot from scipy import linalg from scipy import sparse import gromovWassersteinAveraging as gwa import spectralGW as sgw from geode...
## Script to run graph partitioning experiment on Wiki dataset # Load packages import numpy as np import networkx as nx import matplotlib.pyplot as plt import matplotlib import time import ot from scipy import linalg from scipy import sparse import gromovWassersteinAveraging as gwa import spectralGW as sgw from geode...
de
0.379649
## Script to run graph partitioning experiment on Wiki dataset # Load packages # Load the S-GWL code # Load modules for network partitioning experiments # Breakpoint analysis package # import ruptures as rpt ** May 19, 2020: Gradient descent version of graph_partition Achieve a single graph partition via ...
2.424838
2
python/tests/test_measurements.py
copark86/kontiki
94
6626050
import pytest import numpy as np from kontiki.measurements import StaticRsCameraMeasurement, LiftingRsCameraMeasurement, NewtonRsCameraMeasurement, \ PositionMeasurement, GyroscopeMeasurement, AccelerometerMeasurement from kontiki.rotations import quat_to_rotation_matrix from kontiki.sfm import Landmark, View from...
import pytest import numpy as np from kontiki.measurements import StaticRsCameraMeasurement, LiftingRsCameraMeasurement, NewtonRsCameraMeasurement, \ PositionMeasurement, GyroscopeMeasurement, AccelerometerMeasurement from kontiki.rotations import quat_to_rotation_matrix from kontiki.sfm import Landmark, View from...
en
0.844585
# NOTE: If this test fails, first try to clear the pytest cache using # python3 -m pytest --cache-clear # Take the first landmark # Make sure the measurements agree # Newton method should handle noise in the projection # Beware that this doesn't seem to catch faulty derivatives for the camera # NOTE: If this test fail...
2.095336
2