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 |
|---|---|---|---|---|---|---|---|---|---|---|
practica2/ejercicio5.py | danipozo/practicas-mnii | 1 | 6629351 | #Librerias
import numpy as num
import scipy as sci
from numpy.polynomial import polynomial as pol
def rkj(f,a,b,k,j):
if(j == 0):
h = (b-a)/(2**k)
parcial = 0
for i in range (2**k - 1):
parcial = parcial + f(a+i*h)
res = (h/2)*(f(a) + 2*parcial +f(b))
else:
... | #Librerias
import numpy as num
import scipy as sci
from numpy.polynomial import polynomial as pol
def rkj(f,a,b,k,j):
if(j == 0):
h = (b-a)/(2**k)
parcial = 0
for i in range (2**k - 1):
parcial = parcial + f(a+i*h)
res = (h/2)*(f(a) + 2*parcial +f(b))
else:
... | it | 0.239359 | #Librerias #k = n | 3.145649 | 3 |
rasa_core/policies/ensemble.py | ymihay/dialogue_flow | 1 | 6629352 | <reponame>ymihay/dialogue_flow<gh_stars>1-10
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import io
import json
import logging
import os
import numpy as np
import typing
from builtins import str
from typing import ... | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import io
import json
import logging
import os
import numpy as np
import typing
from builtins import str
from typing import Text, Optional
import rasa_core
from rasa_co... | en | 0.816467 | # type: (DialogueTrainingData, Domain, Featurizer, **Any) -> None # type: (DialogueStateTracker, Domain) -> (float, int) Predicts the next action the bot should take after seeing x. This should be overwritten by more advanced policies to use ML to predict the action. Returns the index of the next actio... | 2.233946 | 2 |
src/website/migrations/0001_initial.py | IkramKhan-DevOps/cw-ai-expression-detector | 0 | 6629353 | <reponame>IkramKhan-DevOps/cw-ai-expression-detector
# Generated by Django 3.2 on 2022-03-07 16:37
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='ScanImage',
... | # Generated by Django 3.2 on 2022-03-07 16:37
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='ScanImage',
fields=[
('id', models.BigAutoFie... | en | 0.87567 | # Generated by Django 3.2 on 2022-03-07 16:37 | 1.738361 | 2 |
test_numpy.py | m-takeuchi/ilislife_wxp | 0 | 6629354 | <filename>test_numpy.py
import numpy as np
def id(x):
# この関数は配列のメモリブロックアドレスを返します
return x.__array_interface__['data'][0]
def get_data_base(arr):
"""与えられたNumPyの配列から、本当のデータを
「持っている」ベース配列を探す"""
base = arr
while isinstance(base.base, np.ndarray):
base = base.base
return base
def array... | <filename>test_numpy.py
import numpy as np
def id(x):
# この関数は配列のメモリブロックアドレスを返します
return x.__array_interface__['data'][0]
def get_data_base(arr):
"""与えられたNumPyの配列から、本当のデータを
「持っている」ベース配列を探す"""
base = arr
while isinstance(base.base, np.ndarray):
base = base.base
return base
def array... | ja | 0.948782 | # この関数は配列のメモリブロックアドレスを返します 与えられたNumPyの配列から、本当のデータを 「持っている」ベース配列を探す ## np.rollすると暗黙にコピーされてメモリが消費される!! # if len(self.data_buffer[0]) > self.BUFFSIZE: # del(self.data_buffer[0][0]) # バッファがサイズを越えたら古いvalから削除 # del(self.data_buffer[1][0]) # バッファがサイズを越えたら古いvalから削除 # del(self.data_buffer[2][0]) # バッファがサイズを越えたら古... | 2.925628 | 3 |
merlion/models/anomaly/forecast_based/prophet.py | ankitakashyap05/Merlion | 2,215 | 6629355 | <reponame>ankitakashyap05/Merlion
#
# Copyright (c) 2021 salesforce.com, inc.
# All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
# For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
#
"""
Adaptation of Facebook's Prophet forecasting model to anomaly ... | #
# Copyright (c) 2021 salesforce.com, inc.
# All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
# For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
#
"""
Adaptation of Facebook's Prophet forecasting model to anomaly detection.
"""
from merlion.model... | en | 0.68969 | # # Copyright (c) 2021 salesforce.com, inc. # All rights reserved. # SPDX-License-Identifier: BSD-3-Clause # For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause # Adaptation of Facebook's Prophet forecasting model to anomaly detection. | 1.537837 | 2 |
auth-api/src/auth_api/schemas/membership.py | karthik-aot/sbc-auth | 3 | 6629356 | <gh_stars>1-10
# Copyright © 2019 Province of British Columbia
#
# 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 applic... | # Copyright © 2019 Province of British Columbia
#
# 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 agr... | en | 0.83851 | # Copyright © 2019 Province of British Columbia # # 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 agr... | 1.923987 | 2 |
src/05/wip.py | j-carson/advent_2021 | 1 | 6629357 | import re
from collections import defaultdict, namedtuple
from pathlib import Path
import numpy as np
from ycecream import y
Point = namedtuple("Point", "x,y")
def generate_points(start, end):
xstep = np.sign(end.x - start.x)
ystep = np.sign(end.y - start.y)
nextpoint = start
while True:
yi... | import re
from collections import defaultdict, namedtuple
from pathlib import Path
import numpy as np
from ycecream import y
Point = namedtuple("Point", "x,y")
def generate_points(start, end):
xstep = np.sign(end.x - start.x)
ystep = np.sign(end.y - start.y)
nextpoint = start
while True:
yi... | fr | 0.921246 | 0,9 -> 5,9 8,0 -> 0,8 9,4 -> 3,4 2,2 -> 2,1 7,0 -> 7,4 6,4 -> 2,0 0,9 -> 2,9 3,4 -> 1,4 0,0 -> 8,8 5,5 -> 8,2 | 3.123338 | 3 |
subclass.py | IanMcLaughlin19/dataClassUtil | 0 | 6629358 | import pprint
def convert_keys_to_snake_case(dict_to_fix: dict) -> dict:
result = {}
for key, value in dict_to_fix.items():
new_key = key.replace("-", "_")
result[new_key] = value
return result
class SubClass:
"""
Not meant to be instantiated directly, this class enables other class... | import pprint
def convert_keys_to_snake_case(dict_to_fix: dict) -> dict:
result = {}
for key, value in dict_to_fix.items():
new_key = key.replace("-", "_")
result[new_key] = value
return result
class SubClass:
"""
Not meant to be instantiated directly, this class enables other class... | en | 0.900745 | Not meant to be instantiated directly, this class enables other classes to be recursively instantiated so that you can make a deeply nested fully typed call such as AlgorandTransaction.application_transaction.local_state_schema.num_byte_slice and have it work. Without the init from json dict method, subclasses that... | 3.366902 | 3 |
src/atcoder/abc003/d/sol_2.py | kagemeka/competitive-programming | 1 | 6629359 | <filename>src/atcoder/abc003/d/sol_2.py<gh_stars>1-10
import typing
import sys
class ModChoosePascal():
def __call__(self, n: int, k: int) -> int:
c = self.__c
return c[n][k] if 0 <= k <= n < len(c) else 0
def __init__(self, n: int, mod: int) -> typing.NoReturn:
c = [[0] * n for _ in range(n)]
... | <filename>src/atcoder/abc003/d/sol_2.py<gh_stars>1-10
import typing
import sys
class ModChoosePascal():
def __call__(self, n: int, k: int) -> int:
c = self.__c
return c[n][k] if 0 <= k <= n < len(c) else 0
def __init__(self, n: int, mod: int) -> typing.NoReturn:
c = [[0] * n for _ in range(n)]
... | none | 1 | 2.564793 | 3 | |
CTD_controller/data_logger_emergencia.py | Raniita/Accuatic-Probe | 1 | 6629360 | from datetime import datetime
import socket
import time
import csv
# Esta version esta pensada para cuando el sensor de profundidad falla
# Es necesario introducir la profundidad de forma manual
# Usar solo cuando sea necesario.
if __name__ == "__main__":
# Arduino IP + port [10.0.1.10 DHCP del barco]
arduino... | from datetime import datetime
import socket
import time
import csv
# Esta version esta pensada para cuando el sensor de profundidad falla
# Es necesario introducir la profundidad de forma manual
# Usar solo cuando sea necesario.
if __name__ == "__main__":
# Arduino IP + port [10.0.1.10 DHCP del barco]
arduino... | es | 0.382767 | # Esta version esta pensada para cuando el sensor de profundidad falla # Es necesario introducir la profundidad de forma manual # Usar solo cuando sea necesario. # Arduino IP + port [10.0.1.10 DHCP del barco] # Creating the csv # Preguntamos por todos los valores # cdom -> Respuesta: <type>;<gain>;<measure>;<mv> (cyclo... | 2.982328 | 3 |
devito/core/operator.py | cc-a/devito | 0 | 6629361 | from devito.core.autotuning import autotune
from devito.dle import NThreads
from devito.ir.support import align_accesses
from devito.parameters import configuration
from devito.operator import Operator
__all__ = ['OperatorCore']
class OperatorCore(Operator):
def _specialize_exprs(self, expressions):
# A... | from devito.core.autotuning import autotune
from devito.dle import NThreads
from devito.ir.support import align_accesses
from devito.parameters import configuration
from devito.operator import Operator
__all__ = ['OperatorCore']
class OperatorCore(Operator):
def _specialize_exprs(self, expressions):
# A... | en | 0.505214 | # Align data accesses to the computational domain # Record the tuned values | 2.387579 | 2 |
step2/dataAugmentationForUsers.py | Lintianqianjin/reappearance-of-some-classical-CNNs | 6 | 6629362 | import cv2
import os
def dataAugmentation(BasePath = 'data/rightOutputs/train_224'):
'''
只需写水平翻转,翻转后的文件的文件名命名规范为文件名末尾加上 _flipx
示例 原文件名 “图片1.png”,翻转后保存的文件命名为 “图片1__flipx.png”
文件保存在'data/flipUserOutputs'目录下
:param BasePath: 待处理的图片文件夹路径
:return:
'''
#********** Begin **********#
#**... | import cv2
import os
def dataAugmentation(BasePath = 'data/rightOutputs/train_224'):
'''
只需写水平翻转,翻转后的文件的文件名命名规范为文件名末尾加上 _flipx
示例 原文件名 “图片1.png”,翻转后保存的文件命名为 “图片1__flipx.png”
文件保存在'data/flipUserOutputs'目录下
:param BasePath: 待处理的图片文件夹路径
:return:
'''
#********** Begin **********#
#**... | zh | 0.929243 | 只需写水平翻转,翻转后的文件的文件名命名规范为文件名末尾加上 _flipx 示例 原文件名 “图片1.png”,翻转后保存的文件命名为 “图片1__flipx.png” 文件保存在'data/flipUserOutputs'目录下 :param BasePath: 待处理的图片文件夹路径 :return: #********** Begin **********# #********** End **********# | 2.056844 | 2 |
server.py | dan-ess/alexa-cycles | 0 | 6629363 | from functools import wraps
import logging
import sys
from flask import Flask
from flask_ask import Ask, statement
from pycycles import Client, ServiceArea
logging.getLogger('flask_ask').setLevel(logging.DEBUG)
app = Flask(__name__)
ask = Ask(app, '/')
# set these.
USERNAME = ''
PASSWORD = ''
def get_cycles_stat... | from functools import wraps
import logging
import sys
from flask import Flask
from flask_ask import Ask, statement
from pycycles import Client, ServiceArea
logging.getLogger('flask_ask').setLevel(logging.DEBUG)
app = Flask(__name__)
ask = Ask(app, '/')
# set these.
USERNAME = ''
PASSWORD = ''
def get_cycles_stat... | it | 0.421933 | # set these. | 2.513717 | 3 |
pendulum/tz/zoneinfo/reader.py | Sn3akyP3t3/pendulum | 2 | 6629364 | import os
import pytzdata
from collections import namedtuple
from struct import unpack
from typing import List, Dict
from pytzdata.exceptions import TimezoneNotFound
from pendulum.utils._compat import PY2
from .exceptions import InvalidZoneinfoFile, InvalidTimezone
from .timezone import Timezone
from .transition im... | import os
import pytzdata
from collections import namedtuple
from struct import unpack
from typing import List, Dict
from pytzdata.exceptions import TimezoneNotFound
from pendulum.utils._compat import PY2
from .exceptions import InvalidZoneinfoFile, InvalidTimezone
from .timezone import Timezone
from .transition im... | en | 0.657733 | Reads compiled zoneinfo TZif (\0, 2 or 3) files. # type: (bool) -> None # type: (str) -> Timezone Read the zoneinfo structure for a given timezone name. :param timezone: The timezone. # type: (str) -> Timezone Read a zoneinfo structure from the given path. :param file_path: The path of a zoneinfo file... | 2.52987 | 3 |
books/model/InvoicePayment.py | nudglabs/books-python-wrappers | 9 | 6629365 | <reponame>nudglabs/books-python-wrappers
#$Id$
class InvoicePayment:
"""This class is used to create object for Invoice Payments."""
def __init__(self):
"""Initialize parameters for Invoice payments."""
self.invoice_payment_id = ''
self.payment_id = ''
self.invoice_id = ''
... | #$Id$
class InvoicePayment:
"""This class is used to create object for Invoice Payments."""
def __init__(self):
"""Initialize parameters for Invoice payments."""
self.invoice_payment_id = ''
self.payment_id = ''
self.invoice_id = ''
self.amount_used = 0.0
self.... | en | 0.660462 | #$Id$ This class is used to create object for Invoice Payments. Initialize parameters for Invoice payments. Set invoice payment id. Args: invoice_payment_id(str): Invoice payment id. Get invoice payment id. Returns: str: Invoice payment id. Set invoice id. Args: ... | 3.333728 | 3 |
stable_baselines/common/mpi_adam.py | yfletberliac/transformrl | 0 | 6629366 | <filename>stable_baselines/common/mpi_adam.py
import mpi4py
import numpy as np
import tensorflow as tf
import stable_baselines.common.tf_util as tf_utils
class MpiAdam(object):
def __init__(self, var_list, *, beta1=0.9, beta2=0.999, epsilon=1e-08, scale_grad_by_procs=True, comm=None,
sess=None):... | <filename>stable_baselines/common/mpi_adam.py
import mpi4py
import numpy as np
import tensorflow as tf
import stable_baselines.common.tf_util as tf_utils
class MpiAdam(object):
def __init__(self, var_list, *, beta1=0.9, beta2=0.999, epsilon=1e-08, scale_grad_by_procs=True, comm=None,
sess=None):... | en | 0.547709 | A parallel MPI implementation of the Adam optimizer for TensorFlow https://arxiv.org/abs/1412.6980 :param var_list: ([TensorFlow Tensor]) the variables :param beta1: (float) Adam beta1 parameter :param beta2: (float) Adam beta1 parameter :param epsilon: (float) to help with prev... | 2.160996 | 2 |
waitress/app/tests/test_models.py | Maxcutex/waitressappv2 | 0 | 6629367 | <reponame>Maxcutex/waitressappv2<filename>waitress/app/tests/test_models.py
import unittest
from app.models import Passphrase, SlackUser, MealSession, MealService
from django.utils import timezone
def create_user():
"""
Creates a user.
:Returns: SlackUser object
"""
user_dummy_data = {
's... | import unittest
from app.models import Passphrase, SlackUser, MealSession, MealService
from django.utils import timezone
def create_user():
"""
Creates a user.
:Returns: SlackUser object
"""
user_dummy_data = {
'slack_id': 'UX03131',
'firstname': 'Test',
'lastname': 'User'... | en | 0.787909 | Creates a user. :Returns: SlackUser object A testcase for the Passphrase model. # Creating passphrase. # Reading passphrase. # Updating passphrase. # Deleting passphrase. A testcase for the SlackUser model. # Reading slack user. # Updating slack user. # Deleting slack user. A testcase for the MealSession model. # ... | 2.879817 | 3 |
tests/graphql/objects/infinite_recursion/objects.py | karlosss/simple_api | 2 | 6629368 | from simple_api.adapters.graphql.graphql import GraphQLAdapter
from simple_api.adapters.utils import generate
from simple_api.object.actions import Action
from simple_api.object.datatypes import ObjectType
from simple_api.object.object import Object
from tests.graphql.graphql_test_utils import build_patterns
def get... | from simple_api.adapters.graphql.graphql import GraphQLAdapter
from simple_api.adapters.utils import generate
from simple_api.object.actions import Action
from simple_api.object.datatypes import ObjectType
from simple_api.object.object import Object
from tests.graphql.graphql_test_utils import build_patterns
def get... | none | 1 | 1.997225 | 2 | |
experiments/gyroMove.py | nshenoy/ev3-python | 3 | 6629369 | #!/usr/bin/env micropython
from ev3dev2.motor import LargeMotor, MediumMotor, OUTPUT_A, OUTPUT_C, OUTPUT_D, SpeedPercent, MoveSteering, follow_for_ms
from ev3dev2.sensor.lego import ColorSensor, GyroSensor, UltrasonicSensor
from ev3dev2.led import Leds
from sys import stderr
from time import sleep
import os
from libs.... | #!/usr/bin/env micropython
from ev3dev2.motor import LargeMotor, MediumMotor, OUTPUT_A, OUTPUT_C, OUTPUT_D, SpeedPercent, MoveSteering, follow_for_ms
from ev3dev2.sensor.lego import ColorSensor, GyroSensor, UltrasonicSensor
from ev3dev2.led import Leds
from sys import stderr
from time import sleep
import os
from libs.... | en | 0.560847 | #!/usr/bin/env micropython Test code for gyro PID drive # Pivot 90 degrees # Drive straight at the angle | 2.552172 | 3 |
custom/ilsgateway/tanzania/reports/delivery.py | rochakchauhan/commcare-hq | 0 | 6629370 | <reponame>rochakchauhan/commcare-hq<filename>custom/ilsgateway/tanzania/reports/delivery.py
from dateutil import rrule
from django.db.models.aggregates import Avg
from corehq.apps.locations.models import SQLLocation
from corehq.apps.reports.datatables import DataTablesHeader, DataTablesColumn
from custom.ilsgateway.fil... | from dateutil import rrule
from django.db.models.aggregates import Avg
from corehq.apps.locations.models import SQLLocation
from corehq.apps.reports.datatables import DataTablesHeader, DataTablesColumn
from custom.ilsgateway.filters import ProgramFilter, ILSDateFilter, ILSAsyncLocationFilter
from custom.ilsgateway.tanz... | none | 1 | 1.823753 | 2 | |
deep_learning/optimiser_L2_CNNC.py | eddymarts/Linear-Regression | 0 | 6629371 | from nn_models import CNNClassifier
from torchvision import datasets, transforms
import torch
from multiprocessing import cpu_count
from torch.utils.data import DataLoader
import matplotlib.pyplot as plt
from sklearn.metrics import r2_score
mnist_train = datasets.MNIST(root="datasets/mnist_train",
... | from nn_models import CNNClassifier
from torchvision import datasets, transforms
import torch
from multiprocessing import cpu_count
from torch.utils.data import DataLoader
import matplotlib.pyplot as plt
from sklearn.metrics import r2_score
mnist_train = datasets.MNIST(root="datasets/mnist_train",
... | none | 1 | 2.784944 | 3 | |
week09/code03.py | byeongal/KMUCP | 0 | 6629372 | def print_my_info(name):
print("안녕하세요.")
print(name+"입니다.")
print("만나서반갑습니다.")
print_my_info("김영재") | def print_my_info(name):
print("안녕하세요.")
print(name+"입니다.")
print("만나서반갑습니다.")
print_my_info("김영재") | none | 1 | 2.073751 | 2 | |
dataProcessor-tests.py | debbieneaeraconsulting/cvp-ingest-documentedtest | 0 | 6629373 | import unittest
import dataProcessor
import json
import logging
import sys
import boto3
import os
from moto import mock_s3
# logger = logging.getLogger()
# logger.level = logging.DEBUG
# stream_handler = logging.StreamHandler(sys.stdout)
# logger.addHandler(stream_handler)
class TestLambdaHandler(unittest.TestCase):... | import unittest
import dataProcessor
import json
import logging
import sys
import boto3
import os
from moto import mock_s3
# logger = logging.getLogger()
# logger.level = logging.DEBUG
# stream_handler = logging.StreamHandler(sys.stdout)
# logger.addHandler(stream_handler)
class TestLambdaHandler(unittest.TestCase):... | en | 0.22842 | # logger = logging.getLogger() # logger.level = logging.DEBUG # stream_handler = logging.StreamHandler(sys.stdout) # logger.addHandler(stream_handler) { "Records": [ { "s3": { "bucket": { "name": "test" }, "o... | 2.19592 | 2 |
tests/urls.py | almahmoud/djcloudbridge | 0 | 6629374 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.conf.urls import include, url
from django.contrib import admin
urlpatterns = [
url(r'admin/', admin.site.urls),
url(r'^', include('djcloudbridge.urls',
namespace='djcloudbridge')),
url(r'^api... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.conf.urls import include, url
from django.contrib import admin
urlpatterns = [
url(r'admin/', admin.site.urls),
url(r'^', include('djcloudbridge.urls',
namespace='djcloudbridge')),
url(r'^api... | en | 0.769321 | # -*- coding: utf-8 -*- | 1.54963 | 2 |
pyiron/base/generic/template.py | pmrv/pyiron | 0 | 6629375 | # coding: utf-8
# Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department
# Distributed under the terms of "New BSD License", see the LICENSE file.
"""
Template class to list the required properties and functions for every pyiron object.
"""
__author__ = "<NAME>"
__c... | # coding: utf-8
# Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department
# Distributed under the terms of "New BSD License", see the LICENSE file.
"""
Template class to list the required properties and functions for every pyiron object.
"""
__author__ = "<NAME>"
__c... | en | 0.742904 | # coding: utf-8 # Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department # Distributed under the terms of "New BSD License", see the LICENSE file. Template class to list the required properties and functions for every pyiron object. Template class to list the required... | 2.198365 | 2 |
hotel/admin.py | Hotel-online/hotel-serveAntes | 0 | 6629376 | <filename>hotel/admin.py<gh_stars>0
from django.contrib import admin
from hotel.models import Reservacion
from hotel.models import CategoriaHabitacion
from hotel.models import Habitacion
from hotel.models import DetalleReservacion
from hotel.models import Forma_de_pago
from hotel.models import Cliente
from hotel.models... | <filename>hotel/admin.py<gh_stars>0
from django.contrib import admin
from hotel.models import Reservacion
from hotel.models import CategoriaHabitacion
from hotel.models import Habitacion
from hotel.models import DetalleReservacion
from hotel.models import Forma_de_pago
from hotel.models import Cliente
from hotel.models... | en | 0.968259 | # Register your models here. | 1.575525 | 2 |
tests/actions/conftest.py | lfpll/great_expectations | 1 | 6629377 | import pytest
from great_expectations.data_context import BaseDataContext
from great_expectations.data_context.types.base import DataContextConfig
@pytest.fixture(scope="module")
def basic_data_context_config_for_validation_operator():
return DataContextConfig(
config_version=1,
plugins_directory... | import pytest
from great_expectations.data_context import BaseDataContext
from great_expectations.data_context.types.base import DataContextConfig
@pytest.fixture(scope="module")
def basic_data_context_config_for_validation_operator():
return DataContextConfig(
config_version=1,
plugins_directory... | none | 1 | 2.002444 | 2 | |
odap/propagators.py | ReeceHumphreys/ODAP | 3 | 6629378 | import numpy as np
from numba import njit as jit, prange
from numpy import pi, sin, cos, sqrt
from scipy import integrate
from scipy.special import iv
# User defined libearayr
import data.planetary_data as pd
import odap.aerodynamics as aero
from .utils import E_to_M, Nu_to_E
def null_perts():
return {
... | import numpy as np
from numba import njit as jit, prange
from numpy import pi, sin, cos, sqrt
from scipy import integrate
from scipy.special import iv
# User defined libearayr
import data.planetary_data as pd
import odap.aerodynamics as aero
from .utils import E_to_M, Nu_to_E
def null_perts():
return {
... | en | 0.722194 | # User defined libearayr # Need to add support for initializing with radius and velocity # Setting the areas and masses # Integration information # Central body properties # Defining perturbations being considered # Defining constants for aerodynamic drag # Central body information # [m] # Local variables # Current orb... | 2.426132 | 2 |
data2/generator.py | giordanoDaloisio/fairness | 0 | 6629379 | <reponame>giordanoDaloisio/fairness
import numpy as np
import pandas as pd
from sklearn.datasets import make_classification
import argparse
# BUILD A SYNTHETIC DATASET
parser = argparse.ArgumentParser(description="Generate a synthetic dataset")
parser.add_argument('-s', '--samples', type=int, help='Number of samples'... | import numpy as np
import pandas as pd
from sklearn.datasets import make_classification
import argparse
# BUILD A SYNTHETIC DATASET
parser = argparse.ArgumentParser(description="Generate a synthetic dataset")
parser.add_argument('-s', '--samples', type=int, help='Number of samples')
parser.add_argument('-c', '--class... | en | 0.382746 | # BUILD A SYNTHETIC DATASET | 3.204121 | 3 |
hdijupyterutils/hdijupyterutils/tests/test_configuration.py | viaduct-ai/sparkmagic | 1 | 6629380 | from mock import MagicMock
from nose.tools import assert_equals, assert_not_equals, raises, with_setup
import json
from hdijupyterutils.configuration import override, override_all, with_override
from hdijupyterutils.configuration import _merge_conf
# This is a sample implementation of how a module would use the conf... | from mock import MagicMock
from nose.tools import assert_equals, assert_not_equals, raises, with_setup
import json
from hdijupyterutils.configuration import override, override_all, with_override
from hdijupyterutils.configuration import _merge_conf
# This is a sample implementation of how a module would use the conf... | en | 0.881668 | # This is a sample implementation of how a module would use the config methods. # We'll use these three functions to test it works. # Configs # Test helper functions # Unit tests begin # Reset | 2.637206 | 3 |
sandbox/lib/jumpscale/Jumpscale/data/schema/tests/6_numeric.py | threefoldtech/threebot_prebuilt | 0 | 6629381 | <filename>sandbox/lib/jumpscale/Jumpscale/data/schema/tests/6_numeric.py<gh_stars>0
# Copyright (C) July 2018: TF TECH NV in Belgium see https://www.threefold.tech/
# In case TF TECH NV ceases to exist (e.g. because of bankruptcy)
# then Incubaid NV also in Belgium will get the Copyright & Authorship for all changes... | <filename>sandbox/lib/jumpscale/Jumpscale/data/schema/tests/6_numeric.py<gh_stars>0
# Copyright (C) July 2018: TF TECH NV in Belgium see https://www.threefold.tech/
# In case TF TECH NV ceases to exist (e.g. because of bankruptcy)
# then Incubaid NV also in Belgium will get the Copyright & Authorship for all changes... | en | 0.8476 | # Copyright (C) July 2018: TF TECH NV in Belgium see https://www.threefold.tech/ # In case TF TECH NV ceases to exist (e.g. because of bankruptcy) # then Incubaid NV also in Belgium will get the Copyright & Authorship for all changes made since July 2018 # and the license will automatically become Apache v2 for al... | 1.840406 | 2 |
savona/exporter/docx_.py | lucianolorenti/savona | 0 | 6629382 | <gh_stars>0
import base64
import json
import os
import tempfile
from io import BytesIO
from pathlib import Path
from sys import int_info
import mistletoe
import nbformat
import pandas as pd
from bs4 import BeautifulSoup
from docx import Document
from docx.enum.style import WD_STYLE_TYPE
from docx.enum.table import WD_... | import base64
import json
import os
import tempfile
from io import BytesIO
from pathlib import Path
from sys import int_info
import mistletoe
import nbformat
import pandas as pd
from bs4 import BeautifulSoup
from docx import Document
from docx.enum.style import WD_STYLE_TYPE
from docx.enum.table import WD_TABLE_ALIGNM... | none | 1 | 2.310264 | 2 | |
learning-labs/PID Analysis/processAnalysis.py | natanascimento/cisco-devnet | 0 | 6629383 | <reponame>natanascimento/cisco-devnet<filename>learning-labs/PID Analysis/processAnalysis.py
#Analisando determinado processo do Windows
import psutil as ps
class checkProc:
def __init__(self):
self.process = ' '
self.pc = ' '
self.exist = ' '
super().__init__()
def checkProc... | Analysis/processAnalysis.py
#Analisando determinado processo do Windows
import psutil as ps
class checkProc:
def __init__(self):
self.process = ' '
self.pc = ' '
self.exist = ' '
super().__init__()
def checkProcess (self):
self.process = ("chrome")
self.pc = (... | pt | 0.938798 | #Analisando determinado processo do Windows #Setar lowercase para os processos #Analisando processos #Atestando se o processo está rodando ou não | 2.88525 | 3 |
flypy/cache/keys.py | filmackay/flypy | 0 | 6629384 | # -*- coding: utf-8 -*-
"""
Bytecode and serialization for the purpose of defining a key to find cached
IR.
"""
from __future__ import print_function, division, absolute_import
import zlib
import types
#===------------------------------------------------------------------===
# Errors
#===----------------------------... | # -*- coding: utf-8 -*-
"""
Bytecode and serialization for the purpose of defining a key to find cached
IR.
"""
from __future__ import print_function, division, absolute_import
import zlib
import types
#===------------------------------------------------------------------===
# Errors
#===----------------------------... | en | 0.353036 | # -*- coding: utf-8 -*- Bytecode and serialization for the purpose of defining a key to find cached IR. #===------------------------------------------------------------------=== # Errors #===------------------------------------------------------------------=== #===-------------------------------------------------------... | 2.551617 | 3 |
libcst/codemod/visitors/_remove_imports.py | jschavesr/LibCST | 880 | 6629385 | <reponame>jschavesr/LibCST
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#
from typing import Any, Dict, Iterable, List, Optional, Sequence, Set, Tuple, Union
import libcst as cst
from l... | # Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#
from typing import Any, Dict, Iterable, List, Optional, Sequence, Set, Tuple, Union
import libcst as cst
from libcst.codemod._context impo... | en | 0.863159 | # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # # We don't handle removing this, so ignore it. # We know any local names will refer to this as an alias if # there is one, and as the origi... | 1.79385 | 2 |
src/sprig/intervals.py | apljungquist/spr | 2 | 6629386 | """Utilities for working with intervals."""
import itertools
from typing import (
Any,
Collection,
Dict,
FrozenSet,
Hashable,
Iterable,
Iterator,
List,
Mapping,
Sequence,
Set,
Tuple,
TypeVar,
)
from typing_extensions import Literal, Protocol
End = Literal["L", "R"]
... | """Utilities for working with intervals."""
import itertools
from typing import (
Any,
Collection,
Dict,
FrozenSet,
Hashable,
Iterable,
Iterator,
List,
Mapping,
Sequence,
Set,
Tuple,
TypeVar,
)
from typing_extensions import Literal, Protocol
End = Literal["L", "R"]
... | en | 0.790868 | Utilities for working with intervals. # pylint: disable=too-few-public-methods Iterate over all possible subsets of `items`. The order in which subsets appear is not guaranteed. >>> sorted(_subsets([0])) [(0,)] >>> sorted(_subsets([0, 1])) [(0,), (0, 1), (1,)] >>> sorted(_subsets([0, 1, 2])) ... | 3.442033 | 3 |
scripts/hail_batch/hgdp1kg_tobwgs_pca_pop_densified_new_variants/hgdp_1kg_tob_wgs_pop_pca_densified.py | populationgenomics/ancestry | 0 | 6629387 | """
Perform pca on samples specific to a population
from the HGDP,1KG, and tob-wgs dataset after densifying.
Reliant on output from
```hgdp1kg_tobwgs_densified_pca_new_variants/
hgdp_1kg_tob_wgs_densified_pca_new_variants.py
```
"""
import hail as hl
import click
import pandas as pd
from analysis_runner import bucket... | """
Perform pca on samples specific to a population
from the HGDP,1KG, and tob-wgs dataset after densifying.
Reliant on output from
```hgdp1kg_tobwgs_densified_pca_new_variants/
hgdp_1kg_tob_wgs_densified_pca_new_variants.py
```
"""
import hail as hl
import click
import pandas as pd
from analysis_runner import bucket... | en | 0.560288 | Perform pca on samples specific to a population from the HGDP,1KG, and tob-wgs dataset after densifying. Reliant on output from ```hgdp1kg_tobwgs_densified_pca_new_variants/ hgdp_1kg_tob_wgs_densified_pca_new_variants.py ``` Query script entry point. # Get samples from the specified population only # Perform PCA # pyl... | 2.471096 | 2 |
tests_dataset_svc.py | cmorisse/openerp-jsonrpc-client-python | 4 | 6629388 | <filename>tests_dataset_svc.py
# coding: utf8
import random
import unittest
import requests
from openerp_jsonrpc_client import *
OE_BASE_SERVER_URL = 'http://localhost:8069'
class TestDatasetService(unittest.TestCase):
def setUp(self):
self.server = OpenERPJSONRPCClient(OE_BASE_SERVER_URL)
def test... | <filename>tests_dataset_svc.py
# coding: utf8
import random
import unittest
import requests
from openerp_jsonrpc_client import *
OE_BASE_SERVER_URL = 'http://localhost:8069'
class TestDatasetService(unittest.TestCase):
def setUp(self):
self.server = OpenERPJSONRPCClient(OE_BASE_SERVER_URL)
def test... | en | 0.52624 | # coding: utf8 search then read a set of objects # TODO: Use db_list to chech db_exists before droppping it test search_read() # Search then load all ir.ui.view test load() test dataset/call_kw test dataset/call_kw via Model proxy # call with args only test exec_workflow via Model proxy # To use this test, you must cre... | 2.50256 | 3 |
keycloak/keycloak_openid.py | mxk1235/python-keycloak | 0 | 6629389 | # -*- coding: utf-8 -*-
#
# The MIT License (MIT)
#
# Copyright (C) 2017 <NAME> <<EMAIL>>
#
# 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 t... | # -*- coding: utf-8 -*-
#
# The MIT License (MIT)
#
# Copyright (C) 2017 <NAME> <<EMAIL>>
#
# 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 t... | en | 0.74768 | # -*- coding: utf-8 -*- # # The MIT License (MIT) # # Copyright (C) 2017 <NAME> <<EMAIL>> # # 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 t... | 1.696956 | 2 |
mpas_ght/src/adjMat.py | trainsn/GNN-Surrogate | 3 | 6629390 | <gh_stars>1-10
import os
import argparse
import numpy as np
import scipy.sparse as sp
import torch
from torch_sparse import coalesce, spspmm
import pdb
def normalize(mx):
"""Row-normalize sparse matrix"""
rowsum = np.array(mx.sum(1))
r_inv = np.power(rowsum, -1).flatten()
r_inv[np.isinf(r... | import os
import argparse
import numpy as np
import scipy.sparse as sp
import torch
from torch_sparse import coalesce, spspmm
import pdb
def normalize(mx):
"""Row-normalize sparse matrix"""
rowsum = np.array(mx.sum(1))
r_inv = np.power(rowsum, -1).flatten()
r_inv[np.isinf(r_inv)] = 0.
... | en | 0.757741 | Row-normalize sparse matrix # horizontal weight # vertical weight # now use as the dimension for self edges | 2.321362 | 2 |
src/3-12.py | Zepyhrus/tf2 | 0 | 6629391 | <filename>src/3-12.py
import os
from os.path import join, split, basename
import tensorflow as tf
import numpy as np
from tensorflow.keras.layers import Dense, Input, Layer
from tensorflow.keras.models import Model
import random
class MyLayer(Layer):
def __init__(self, output_dim, **kwargs):
self.output_dim =... | <filename>src/3-12.py
import os
from os.path import join, split, basename
import tensorflow as tf
import numpy as np
from tensorflow.keras.layers import Dense, Input, Layer
from tensorflow.keras.models import Model
import random
class MyLayer(Layer):
def __init__(self, output_dim, **kwargs):
self.output_dim =... | en | 0.510315 | # define build # define trainable variables # # train data # test data # predict # define the network # compile the model # train # test # predict | 2.817622 | 3 |
yhackss17/apps.py | DannyKong12/yhack17 | 1 | 6629392 | from django.apps import AppConfig
class Yhackss17Config(AppConfig):
name = 'yhackss17'
| from django.apps import AppConfig
class Yhackss17Config(AppConfig):
name = 'yhackss17'
| none | 1 | 1.139006 | 1 | |
cosmic-core/systemvm/patches/centos7/opt/cosmic/router/bin/cs/CsNetfilter.py | sanderv32/cosmic | 64 | 6629393 | <gh_stars>10-100
from __future__ import print_function
import logging
from subprocess import Popen, PIPE
import CsHelper
from databag.cs_iptables_save import Tables
class CsChain(object):
def __init__(self):
self.chain = { }
self.last_added = ''
self.count = { }
def add(self, table,... | from __future__ import print_function
import logging
from subprocess import Popen, PIPE
import CsHelper
from databag.cs_iptables_save import Tables
class CsChain(object):
def __init__(self):
self.chain = { }
self.last_added = ''
self.count = { }
def add(self, table, chain):
... | en | 0.890833 | # Table # Chain # Rule Compare reality with what is needed # Ensure all inbound/outbound chains have a default drop rule # PASS 1: Ensure all chains are present and cleanup unused rules. # PASS 2: Create rules # This makes the logs very verbose, you probably don't want this # Uncomment when debugging # logging.info("A... | 2.299341 | 2 |
pyscf/shciscf/examples/03_c2_diffsymm.py | crisely09/pyscf | 2 | 6629394 | <reponame>crisely09/pyscf<gh_stars>1-10
#!/usr/bin/env python
# Copyright 2014-2019 The PySCF Developers. 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://w... | #!/usr/bin/env python
# Copyright 2014-2019 The PySCF Developers. 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
#
# U... | en | 0.823942 | #!/usr/bin/env python # Copyright 2014-2019 The PySCF Developers. 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 # # U... | 1.819915 | 2 |
app/populate_database.py | Rojber/open_password_management_API | 2 | 6629395 | <gh_stars>1-10
from random import randint
from bson.objectid import ObjectId
from faker import Faker
from faker.providers import internet, person, company, address, phone_number, date_time
fake = Faker()
fake.add_provider(internet)
fake.add_provider(person)
fake.add_provider(company)
fake.add_provider(address)
fake.ad... | from random import randint
from bson.objectid import ObjectId
from faker import Faker
from faker.providers import internet, person, company, address, phone_number, date_time
fake = Faker()
fake.add_provider(internet)
fake.add_provider(person)
fake.add_provider(company)
fake.add_provider(address)
fake.add_provider(phon... | en | 0.622171 | # Insert users directly into MongoDB # Print to the console the ObjectID of the new document | 2.530566 | 3 |
RC_RPi_v2/Stash/p5listen.py | njbuch/PiS2_Controller | 0 | 6629396 | import smbus
import time
# for RPI version 1, use "bus = smbus.SMBus(0)"
bus = smbus.SMBus(1)
# This is the address we setup in the Arduino Program
address = 0x07
def writeNumber(value):
bus.write_byte(address, value)
# bus.write_byte_data(address, 0, value)
return -1
def readNumber():
number = bus.r... | import smbus
import time
# for RPI version 1, use "bus = smbus.SMBus(0)"
bus = smbus.SMBus(1)
# This is the address we setup in the Arduino Program
address = 0x07
def writeNumber(value):
bus.write_byte(address, value)
# bus.write_byte_data(address, 0, value)
return -1
def readNumber():
number = bus.r... | en | 0.729409 | # for RPI version 1, use "bus = smbus.SMBus(0)" # This is the address we setup in the Arduino Program # bus.write_byte_data(address, 0, value) # number = bus.read_byte_data(address, 1) # sleep one second | 3.395766 | 3 |
pymath/divisible_by_7_not_5/__init__.py | JASTYN/pythonmaster | 3 | 6629397 | class Divisible7(object):
"""
class that gets all the numbers divisible by 7, but not by 5 in a range
"""
def __init__(self, rnge):
self.rnge = rnge
def div7(self):
return ",".join([str(x) for x in self.rnge if x % 7 == 0 and x % 5 != 0])
# solution two
def div7_two(self):... | class Divisible7(object):
"""
class that gets all the numbers divisible by 7, but not by 5 in a range
"""
def __init__(self, rnge):
self.rnge = rnge
def div7(self):
return ",".join([str(x) for x in self.rnge if x % 7 == 0 and x % 5 != 0])
# solution two
def div7_two(self):... | en | 0.969047 | class that gets all the numbers divisible by 7, but not by 5 in a range # solution two | 3.95945 | 4 |
foodSearchApp/admin.py | cpankajr/Food-Search-App | 2 | 6629398 | from django.contrib import admin
from django.contrib.auth.models import Group
from django.utils.safestring import mark_safe
from django.urls import reverse
from foodSearchApp.models import *
admin.site.register(FoodSearchData) | from django.contrib import admin
from django.contrib.auth.models import Group
from django.utils.safestring import mark_safe
from django.urls import reverse
from foodSearchApp.models import *
admin.site.register(FoodSearchData) | none | 1 | 1.270189 | 1 | |
python/ymt_components/ymt_face_eyepupil_01/__init__.py | yamahigashi/mgear_shifter_components | 10 | 6629399 | """mGear shifter components"""
# pylint: disable=import-error,W0201,C0111,C0112
import maya.cmds as cmds
import maya.OpenMaya as om1
import maya.api.OpenMaya as om
import pymel.core as pm
from pymel.core import datatypes
import exprespy.cmd
from mgear.shifter import component
from mgear.rigbits.facial_rigger import ... | """mGear shifter components"""
# pylint: disable=import-error,W0201,C0111,C0112
import maya.cmds as cmds
import maya.OpenMaya as om1
import maya.api.OpenMaya as om
import pymel.core as pm
from pymel.core import datatypes
import exprespy.cmd
from mgear.shifter import component
from mgear.rigbits.facial_rigger import ... | en | 0.553461 | mGear shifter components # pylint: disable=import-error,W0201,C0111,C0112 # getTransformLookingAt, # getChainTransform2, # pylint: disable=using-constant-test, wrong-import-order # For type annotation # NOQA: F401 pylint: disable=unused-import # NOQA: F401, F811 pylint: disable=unused-import,reimported # NOQA: F401 pyl... | 1.671628 | 2 |
test/countries/__init__.py | LaudateCorpus1/python-holidays | 0 | 6629400 | # -*- coding: utf-8 -*-
# python-holidays
# ---------------
# A fast, efficient Python library for generating country, province and state
# specific sets of holidays on the fly. It aims to make determining whether a
# specific date is a holiday as fast and flexible as possible.
#
# Authors: dr-prodigy <<EMAIL>> ... | # -*- coding: utf-8 -*-
# python-holidays
# ---------------
# A fast, efficient Python library for generating country, province and state
# specific sets of holidays on the fly. It aims to make determining whether a
# specific date is a holiday as fast and flexible as possible.
#
# Authors: dr-prodigy <<EMAIL>> ... | en | 0.735528 | # -*- coding: utf-8 -*- # python-holidays # --------------- # A fast, efficient Python library for generating country, province and state # specific sets of holidays on the fly. It aims to make determining whether a # specific date is a holiday as fast and flexible as possible. # # Authors: dr-prodigy <<EMAIL>> (... | 2.109108 | 2 |
Mining/demo.py | ichiro17/FinMind | 3 | 6629401 | <gh_stars>1-10
from FinMind.Mining import Mind
_2330 = Mind.Stock('2330','2019-01-01')
_2330.StockPrice.head()
_2330.FinancialStatements.head()
_2330.ShareHolding.head()
_2330.InstitutionalInvestors.head()
_2330.MarginPurchaseShortSale.head()
_2330.MonthRevenue.head()
_2330.HoldingSharesPer.head()
_2330.BalanceShe... | from FinMind.Mining import Mind
_2330 = Mind.Stock('2330','2019-01-01')
_2330.StockPrice.head()
_2330.FinancialStatements.head()
_2330.ShareHolding.head()
_2330.InstitutionalInvestors.head()
_2330.MarginPurchaseShortSale.head()
_2330.MonthRevenue.head()
_2330.HoldingSharesPer.head()
_2330.BalanceSheet.head()
_2330.S... | none | 1 | 1.758441 | 2 | |
alipay/aop/api/response/AlipayCommerceYuntaskPointinstructionQueryResponse.py | antopen/alipay-sdk-python-all | 0 | 6629402 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
from alipay.aop.api.domain.PointInstruction import PointInstruction
class AlipayCommerceYuntaskPointinstructionQueryResponse(AlipayResponse):
def __init__(self):
super(AlipayCommer... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
from alipay.aop.api.domain.PointInstruction import PointInstruction
class AlipayCommerceYuntaskPointinstructionQueryResponse(AlipayResponse):
def __init__(self):
super(AlipayCommer... | en | 0.352855 | #!/usr/bin/env python # -*- coding: utf-8 -*- | 1.989204 | 2 |
backend/todoist/urls.py | Zhiwei1996/Todoist | 0 | 6629403 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.conf.urls import url
from rest_framework.urlpatterns import format_suffix_patterns
from todoist import views
urlpatterns = [
# url(r'^$', views.index, name='index'),
url(r'^todos/$', views.TodoList.as_view()),
url(r'^todos/(?P<pk>[0-9]+)/$', views.... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.conf.urls import url
from rest_framework.urlpatterns import format_suffix_patterns
from todoist import views
urlpatterns = [
# url(r'^$', views.index, name='index'),
url(r'^todos/$', views.TodoList.as_view()),
url(r'^todos/(?P<pk>[0-9]+)/$', views.... | en | 0.412533 | #!/usr/bin/env python # -*- coding: utf-8 -*- # url(r'^$', views.index, name='index'), | 2.068374 | 2 |
src/faces.py | BachFive/481_FR | 0 | 6629404 | import numpy as np
import cv2
import pickle
face_cascade = cv2.CascadeClassifier('cascades/data/haarcascade_frontalface_alt2.xml')
eye_cascade = cv2.CascadeClassifier('cascades/data/haarcascade_eye.xml')
eyeglasses_cascade = cv2.CascadeClassifier('cascades/data/haarcascade_eye_tree_eyeglasses.xml')
smile_cascade = cv2... | import numpy as np
import cv2
import pickle
face_cascade = cv2.CascadeClassifier('cascades/data/haarcascade_frontalface_alt2.xml')
eye_cascade = cv2.CascadeClassifier('cascades/data/haarcascade_eye.xml')
eyeglasses_cascade = cv2.CascadeClassifier('cascades/data/haarcascade_eye_tree_eyeglasses.xml')
smile_cascade = cv2... | en | 0.565406 | # Capture frame-by-frame # print(x,y,w,h) # (ycord_start, ycord_end) # recognize? deep learned model predict keras tensorflow pytorch scikit learn # print(id_) # BGR 0-255 # Display the resulting frame # When everything done, release the capture | 2.8293 | 3 |
David and Pooja/++Validating Linked Mods/Python-3.0/Tools/pybench/pybench.py | LinkedModernismProject/web_code | 1 | 6629405 | <filename>David and Pooja/++Validating Linked Mods/Python-3.0/Tools/pybench/pybench.py
#!/usr/local/bin/python -O
""" A Python Benchmark Suite
"""
#
# Note: Please keep this module compatible to Python 1.5.2.
#
# Tests may include features in later Python versions, but these
# should then be embedded in try-except cl... | <filename>David and Pooja/++Validating Linked Mods/Python-3.0/Tools/pybench/pybench.py
#!/usr/local/bin/python -O
""" A Python Benchmark Suite
"""
#
# Note: Please keep this module compatible to Python 1.5.2.
#
# Tests may include features in later Python versions, but these
# should then be embedded in try-except cl... | en | 0.813797 | #!/usr/local/bin/python -O A Python Benchmark Suite # # Note: Please keep this module compatible to Python 1.5.2. # # Tests may include features in later Python versions, but these # should then be embedded in try-except clauses in the configuration # module Setup.py. # # pybench Copyright \ Copyright (c), 1997-2006, <... | 1.674299 | 2 |
examples/reader_demo.py | alenrajsp/tcxreader | 1 | 6629406 | <filename>examples/reader_demo.py
"""
Simple example of using the TCX reader!
"""
from tcxreader.tcxreader import TCXReader, TCXTrackPoint, TCXExercise
tcx_reader = TCXReader()
file_location = '../example_data/15.tcx'
data: TCXExercise = tcx_reader.read(file_location)
print("Output")
print(str(data.trackpoints[0]))
... | <filename>examples/reader_demo.py
"""
Simple example of using the TCX reader!
"""
from tcxreader.tcxreader import TCXReader, TCXTrackPoint, TCXExercise
tcx_reader = TCXReader()
file_location = '../example_data/15.tcx'
data: TCXExercise = tcx_reader.read(file_location)
print("Output")
print(str(data.trackpoints[0]))
... | en | 0.290551 | Simple example of using the TCX reader! Example output: = {TCXTrackPoint} TPX_speed = {float} 5.011000156402588 cadence = {float} 80 distance = {float} 514.0499877929688 elevation = {float} 46.79999923706055 hr_value = {int} 134 latitude = {float} 45.5244944896549 longitude = {float} 13.596355207264423 ... | 2.675137 | 3 |
smartfridge/sql_connector/__init__.py | ndoering/smartfridge | 0 | 6629407 | <reponame>ndoering/smartfridge
from .sqlconnector import SQLConnector, MySQLConnector
| from .sqlconnector import SQLConnector, MySQLConnector | none | 1 | 1.10701 | 1 | |
steam/enums/emsg.py | tjensen/steam | 727 | 6629408 | <reponame>tjensen/steam<filename>steam/enums/emsg.py
"""The EMsg enum contains many members and takes a bit to load.
For this reason it is seperate, and imported only when needed.
"""
from steam.enums.base import SteamIntEnum
class EMsg(SteamIntEnum):
Invalid = 0
Multi = 1
ProtobufWrapped = 2
Generi... | """The EMsg enum contains many members and takes a bit to load.
For this reason it is seperate, and imported only when needed.
"""
from steam.enums.base import SteamIntEnum
class EMsg(SteamIntEnum):
Invalid = 0
Multi = 1
ProtobufWrapped = 2
GenericReply = 100
BaseGeneral = 100
DestJobFailed ... | en | 0.94147 | The EMsg enum contains many members and takes a bit to load. For this reason it is seperate, and imported only when needed. #: removed #: removed # ClientSessionUpdateAuthTicket = 137 #: removed #: removed #: removed #: removed #: removed # AISUpdatePackageInfo = 404 #: removed #: removed #: removed #: removed #: r... | 1.577182 | 2 |
gpytorch/kernels/rbf_kernel_grad.py | shalijiang/gpytorch | 2 | 6629409 | <gh_stars>1-10
#!/usr/bin/env python3
from .rbf_kernel import RBFKernel
import torch
from ..lazy.kronecker_product_lazy_tensor import KroneckerProductLazyTensor
class RBFKernelGrad(RBFKernel):
r"""
Computes a covariance matrix of the RBF kernel that models the covariance
between the values and partial der... | #!/usr/bin/env python3
from .rbf_kernel import RBFKernel
import torch
from ..lazy.kronecker_product_lazy_tensor import KroneckerProductLazyTensor
class RBFKernelGrad(RBFKernel):
r"""
Computes a covariance matrix of the RBF kernel that models the covariance
between the values and partial derivatives for in... | en | 0.568849 | #!/usr/bin/env python3 Computes a covariance matrix of the RBF kernel that models the covariance between the values and partial derivatives for inputs :math:`\mathbf{x_1}` and :math:`\mathbf{x_2}`. See :class:`gpytorch.kernels.Kernel` for descriptions of the lengthscale options. .. note:: Thi... | 2.6327 | 3 |
simple_exercises/lanesexercises/exam1_repitition/1.py | ilante/programming_immanuela_englander | 0 | 6629410 | <filename>simple_exercises/lanesexercises/exam1_repitition/1.py<gh_stars>0
#Write a protram that takes a string from the user and prints on the elememts in odd postion on the screen (the first postion is 0).
x=input("Dear user please provide a string ")
print(x[1:len(x):2])
| <filename>simple_exercises/lanesexercises/exam1_repitition/1.py<gh_stars>0
#Write a protram that takes a string from the user and prints on the elememts in odd postion on the screen (the first postion is 0).
x=input("Dear user please provide a string ")
print(x[1:len(x):2])
| en | 0.928512 | #Write a protram that takes a string from the user and prints on the elememts in odd postion on the screen (the first postion is 0). | 3.972702 | 4 |
setup.py | xypron/pyrelayctl | 6 | 6629411 | #!/usr/bin/env python3
#
# Copyright (c) 2016, <NAME> <<EMAIL>>
# 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
# not... | #!/usr/bin/env python3
#
# Copyright (c) 2016, <NAME> <<EMAIL>>
# 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
# not... | en | 0.695486 | #!/usr/bin/env python3 # # Copyright (c) 2016, <NAME> <<EMAIL>> # 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 # not... | 1.01009 | 1 |
Examples/AppKit/ClassBrowser/setup.py | linuxfood/pyobjc-framework-Cocoa-test | 0 | 6629412 | """
Script for building the example.
Usage:
python3 setup.py py2app
"""
from setuptools import setup
plist = {"NSMainNibFile": "ClassBrowser"}
setup(
name="ClassBrowser",
app=["ClassBrowser.py"],
data_files=["ClassBrowser.nib"],
options={"py2app": {"plist": plist}},
setup_requires=["py2app", "... | """
Script for building the example.
Usage:
python3 setup.py py2app
"""
from setuptools import setup
plist = {"NSMainNibFile": "ClassBrowser"}
setup(
name="ClassBrowser",
app=["ClassBrowser.py"],
data_files=["ClassBrowser.nib"],
options={"py2app": {"plist": plist}},
setup_requires=["py2app", "... | en | 0.720983 | Script for building the example. Usage: python3 setup.py py2app | 1.668225 | 2 |
i3d_tf_to_pt.py | eric-xw/kinetics-i3d-pytorch | 33 | 6629413 | <filename>i3d_tf_to_pt.py
import argparse
from matplotlib import pyplot as plt
import tensorflow as tf
import torch
import torchvision.transforms as transforms
import torchvision.datasets as datasets
from src.i3dtf import InceptionI3d
from src.i3dpt import I3D
from src.monitorutils import compare_outputs
def transf... | <filename>i3d_tf_to_pt.py
import argparse
from matplotlib import pyplot as plt
import tensorflow as tf
import torch
import torchvision.transforms as transforms
import torchvision.datasets as datasets
from src.i3dtf import InceptionI3d
from src.i3dpt import I3D
from src.monitorutils import compare_outputs
def transf... | en | 0.726357 | # normalize, # Initialize input params # Number of items in depth (temporal) dimension # Initialize dataset # Initialize pytorch I3D # Initialzie tensorflow I3D # Tensorflow forward pass # Get params for tensorflow weight retreival # Load saved tensorflow weights # Transfer weights fro... | 2.294131 | 2 |
backend/settings.py | lietu/pydashery | 1 | 6629414 | # Which widgets should be enabled?
WIDGETS = [
{
"type": "Clock",
# Optional, defaults to ISO-8601 -like format
"format": "%m/%d/%Y\n%I:%M:%S %p"
},
{
"type": "FunctionResult",
"update_minutes": 0.0167,
# Definition can be either "module.path:class.method" or
... | # Which widgets should be enabled?
WIDGETS = [
{
"type": "Clock",
# Optional, defaults to ISO-8601 -like format
"format": "%m/%d/%Y\n%I:%M:%S %p"
},
{
"type": "FunctionResult",
"update_minutes": 0.0167,
# Definition can be either "module.path:class.method" or
... | en | 0.598354 | # Which widgets should be enabled? # Optional, defaults to ISO-8601 -like format # Definition can be either "module.path:class.method" or # "module.path:function_name" # Check for updates this many times per second # Which interface and port to listen to # Reloads the app automatically when code changes are detected | 2.507238 | 3 |
deprecated/tests/test_PulsedProgramming.py | 3it-nano/QDMS | 1 | 6629415 | import qdms
import numpy as np
def test_read_resistance_without_variability():
memristor = qdms.Data_Driven()
circuit = qdms.Circuit(memristor, 1)
pulsed_programming = qdms.PulsedProgramming(circuit, 2)
value = pulsed_programming.read_resistance(pulsed_programming.circuit.memristor_model)
assert r... | import qdms
import numpy as np
def test_read_resistance_without_variability():
memristor = qdms.Data_Driven()
circuit = qdms.Circuit(memristor, 1)
pulsed_programming = qdms.PulsedProgramming(circuit, 2)
value = pulsed_programming.read_resistance(pulsed_programming.circuit.memristor_model)
assert r... | none | 1 | 2.668911 | 3 | |
scripts/update_version.py | confiare/SN-Core | 53 | 6629416 | import tomlkit
import os
self_dir = os.path.dirname(__file__)
config_path = os.path.join(self_dir, "update_version.toml")
with open(config_path, 'r') as config_file:
config = tomlkit.loads(config_file.read())
VERSION = ".".join([str(config['version'][sem]) for sem in ['major', 'minor', 'patch']])
if "core" in c... | import tomlkit
import os
self_dir = os.path.dirname(__file__)
config_path = os.path.join(self_dir, "update_version.toml")
with open(config_path, 'r') as config_file:
config = tomlkit.loads(config_file.read())
VERSION = ".".join([str(config['version'][sem]) for sem in ['major', 'minor', 'patch']])
if "core" in c... | en | 0.607774 | # update version references in all three crates # update version number in setup.cfg # update version number in documentation # update DESCRIPTION file | 2.019559 | 2 |
oceny.py | Ellectronx/wsb-oceny | 5 | 6629417 | #!/usr/bin/env python
# main script from: https://www.lisenet.com/2017/basic-python-script-to-log-in-to-website-using-selenium-webdriver/
import os
import time
import signal
import hashlib
import subprocess
from selenium import webdriver
from bs4 import BeautifulSoup
import db
import fb
from helper import *
from cre... | #!/usr/bin/env python
# main script from: https://www.lisenet.com/2017/basic-python-script-to-log-in-to-website-using-selenium-webdriver/
import os
import time
import signal
import hashlib
import subprocess
from selenium import webdriver
from bs4 import BeautifulSoup
import db
import fb
from helper import *
from cre... | en | 0.280893 | #!/usr/bin/env python # main script from: https://www.lisenet.com/2017/basic-python-script-to-log-in-to-website-using-selenium-webdriver/ #URL # Set a user agent string to help parse webserver logs easily # DEFINE USERNAME & PASSWORD FIELDS # Clear the input fields #PRESS LOGIN BUTTON # create a database connection #pr... | 2.995893 | 3 |
final_table.py | Mfallh/cocktail-nutrition-facts | 0 | 6629418 | <gh_stars>0
import pandas as pd
cocktails = pd.read_csv('/Users/mariusfall/Desktop/cocktails.csv')
nutrition = pd.read_csv('/Users/mariusfall/Desktop/nutrition_facts_cleaned.csv')
states = pd.read_csv('/Users/mariusfall/Desktop/state_ranking_cleaned.csv')
table_final = (pd.merge(cocktails, nutrition, left_on='name', ri... | import pandas as pd
cocktails = pd.read_csv('/Users/mariusfall/Desktop/cocktails.csv')
nutrition = pd.read_csv('/Users/mariusfall/Desktop/nutrition_facts_cleaned.csv')
states = pd.read_csv('/Users/mariusfall/Desktop/state_ranking_cleaned.csv')
table_final = (pd.merge(cocktails, nutrition, left_on='name', right_on='cock... | none | 1 | 2.485255 | 2 | |
onadata/apps/api/urls.py | jnm/kobocat-branches-archive-20200507 | 0 | 6629419 | from django.conf.urls import url
from rest_framework import routers
from rest_framework.response import Response
from rest_framework.reverse import reverse
from rest_framework.urlpatterns import format_suffix_patterns
from rest_framework.views import APIView
from onadata.apps.api.viewsets.charts_viewset import ChartsV... | from django.conf.urls import url
from rest_framework import routers
from rest_framework.response import Response
from rest_framework.reverse import reverse
from rest_framework.urlpatterns import format_suffix_patterns
from rest_framework.views import APIView
from onadata.apps.api.viewsets.charts_viewset import ChartsV... | en | 0.576656 | # Dynamically generated routes. # Generated using @action or @link decorators on methods of the viewset # Determine any `@action` or `@link` decorated methods on the viewset # Dynamic routes (@link or @action decorator) # Standard route Return a view to use as the API root. ## KoBo JSON Rest API endpoints: ### Data * ... | 1.656102 | 2 |
ean13-generator.py | maxmumford/random-ean13-generator | 13 | 6629420 | <filename>ean13-generator.py
#! /usr/bin/python
"""
This script generates a random EAN13 number and prints it to the standard out.
"""
from random import randrange
def generate_12_random_numbers():
numbers = []
for x in range(12):
numbers.append(randrange(10))
return numbers
def calculate_checks... | <filename>ean13-generator.py
#! /usr/bin/python
"""
This script generates a random EAN13 number and prints it to the standard out.
"""
from random import randrange
def generate_12_random_numbers():
numbers = []
for x in range(12):
numbers.append(randrange(10))
return numbers
def calculate_checks... | en | 0.628551 | #! /usr/bin/python This script generates a random EAN13 number and prints it to the standard out. Calculates the checksum for an EAN13 @param list ean: List of 12 numbers for first part of EAN13 :returns: The checksum for `ean`. :rtype: Integer | 3.893247 | 4 |
astropop/framedata/tests/test_memmap.py | FCeoni/astropop | 1 | 6629421 | <reponame>FCeoni/astropop<filename>astropop/framedata/tests/test_memmap.py<gh_stars>1-10
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
import mmap
import pytest
import pytest_check as check
from astropop.framedata import MemMapArray, create_array_memmap, \
dele... | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
import mmap
import pytest
import pytest_check as check
from astropop.framedata import MemMapArray, create_array_memmap, \
delete_array_memmap, EmptyDataError
from astropy import units as u
import numpy as np
import ... | en | 0.541637 | # Licensed under a 3-clause BSD style license - see LICENSE.rst # Creation # Deletion # Since for the uses the object is overwritten, we do it here too # None should not raise errors # dtype whould rise # shape whould rise # item whould rise # set item whould rise # First keep the file # Remove the file # raises error ... | 1.999437 | 2 |
subs2apkg.py | Zutatensuppe/subs2apkg | 0 | 6629422 | import argparse
import random
import subprocess
import pysubs2
import genanki
import re
from pathlib import Path
OFFSET_AUDIO_START = -250
OFFSET_AUDIO_END = 250
OFFSET_IMAGE = 0
model = genanki.Model(
1740692504,
"japanese + subs2srs",
fields=[
{"name": "SequenceMarker"},
{"name": "Expres... | import argparse
import random
import subprocess
import pysubs2
import genanki
import re
from pathlib import Path
OFFSET_AUDIO_START = -250
OFFSET_AUDIO_END = 250
OFFSET_IMAGE = 0
model = genanki.Model(
1740692504,
"japanese + subs2srs",
fields=[
{"name": "SequenceMarker"},
{"name": "Expres... | en | 0.253666 | {{FrontSide}} <hr id=answer> <div class=jp> {{furigana:Reading}} </div><br> {{Meaning}} .card { font-family: arial; font-size: 20px; text-align: center; color: black; background-color: white; } .jp { font-size: 30px } .win .jp { font-family: "MS Mincho", "MS 明朝"; } .mac .jp { font-family: "Hiragino Mincho Pro", ... | 2.277734 | 2 |
ifpi/Lavagem de carros.py | AlexCaprian/Python | 0 | 6629423 | <reponame>AlexCaprian/Python<filename>ifpi/Lavagem de carros.py
#A variável 'x' recebe um valor constante 12
x=12
#A variável 'y' recebe um valor constante 12.50
y=12.50
#A variável 'z' recebe um valor do resultado da formula de calculo entre x e y
z=x*y
#imprime 'Eu cobro R$ 12.5 para cada lavagem, então se eu lavar {... | de carros.py
#A variável 'x' recebe um valor constante 12
x=12
#A variável 'y' recebe um valor constante 12.50
y=12.50
#A variável 'z' recebe um valor do resultado da formula de calculo entre x e y
z=x*y
#imprime 'Eu cobro R$ 12.5 para cada lavagem, então se eu lavar {x} carros irei arrecadar R$ {z}'
print(f'Eu cobro R... | pt | 0.969327 | #A variável 'x' recebe um valor constante 12 #A variável 'y' recebe um valor constante 12.50 #A variável 'z' recebe um valor do resultado da formula de calculo entre x e y #imprime 'Eu cobro R$ 12.5 para cada lavagem, então se eu lavar {x} carros irei arrecadar R$ {z}' | 3.745811 | 4 |
ppjson/ppjson.py | jiamo/ppjson | 1 | 6629424 | from sly import Lexer, Parser
import sys
from copy import deepcopy
class JsonLexer(Lexer):
tokens = {
LSBRACKET,
RSBRACKET,
LBRACE,
RBRACE,
COLON,
STRING,
SINGLE_STRING,
CONSTANT,
COMMA,
INT,
FLOAT,
LITERRAL_VALUE,
... | from sly import Lexer, Parser
import sys
from copy import deepcopy
class JsonLexer(Lexer):
tokens = {
LSBRACKET,
RSBRACKET,
LBRACE,
RBRACE,
COLON,
STRING,
SINGLE_STRING,
CONSTANT,
COMMA,
INT,
FLOAT,
LITERRAL_VALUE,
... | en | 0.503461 | # WS = r'[ \t\n\r]+' # todo how to do it # literals = { '=', '+', '-', '*', '/', '(', ')' } # Tokens #-\[\]-\U0010ffff]+|\\(["\/\\bfnrt]|u[0-9A-Fa-f]{4}))*"') # @_(r"'([^'\n]|(\\'))*'") # def STRING(self, t): # t.value = str(t.value[1:-1]) # return t # TODO simple the process may be can just return the p.memlis... | 2.499412 | 2 |
datadog_checks_base/datadog_checks/base/checks/win/winpdh_base.py | remicalixte/integrations-core | 1 | 6629425 | # (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from collections import defaultdict
from typing import Dict, List
import win32wnet
from six import iteritems
from ... import AgentCheck, is_affirmative
from ...utils.containers import hash_mutable
try:
... | # (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from collections import defaultdict
from typing import Dict, List
import win32wnet
from six import iteritems
from ... import AgentCheck, is_affirmative
from ...utils.containers import hash_mutable
try:
... | en | 0.842167 | # (C) Datadog, Inc. 2018-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) PDH based check. check. Windows only. # To support optional agentConfig # TODO: Change signature to (self, name, init_config, instances, counter_list) once subclasses have been edited # type: List[Li... | 1.918512 | 2 |
src/envs/__init__.py | OkYongChoi/smac-windows | 64 | 6629426 | from functools import partial
from envs.starcraft2.starcraft2 import MultiAgentEnv, StarCraft2Env
import sys
import os
def env_fn(env, **kwargs) -> MultiAgentEnv:
return env(**kwargs)
REGISTRY = {}
REGISTRY["sc2"] = partial(env_fn, env=StarCraft2Env)
if sys.platform == "linux":
os.environ.setdefault("SC2PATH... | from functools import partial
from envs.starcraft2.starcraft2 import MultiAgentEnv, StarCraft2Env
import sys
import os
def env_fn(env, **kwargs) -> MultiAgentEnv:
return env(**kwargs)
REGISTRY = {}
REGISTRY["sc2"] = partial(env_fn, env=StarCraft2Env)
if sys.platform == "linux":
os.environ.setdefault("SC2PATH... | none | 1 | 2.305497 | 2 | |
sdcit/hsic.py | sanghack81/SDCIT | 11 | 6629427 | <gh_stars>10-100
import numpy as np
import scipy.stats
from typing import List, Tuple
from sdcit.cython_impl.cy_sdcit import cy_hsic
from sdcit.utils import p_value_of, cythonize, random_seeds, centering
def HSIC(K: np.ndarray, L: np.ndarray, p_val_method='bootstrap', num_boot=1000) -> float:
if p_val_method == ... | import numpy as np
import scipy.stats
from typing import List, Tuple
from sdcit.cython_impl.cy_sdcit import cy_hsic
from sdcit.utils import p_value_of, cythonize, random_seeds, centering
def HSIC(K: np.ndarray, L: np.ndarray, p_val_method='bootstrap', num_boot=1000) -> float:
if p_val_method == 'bootstrap':
... | en | 0.641151 | Hilbert-Schmidt Independence Criterion where null distribution is based on approximated Gamma distribution References ---------- <NAME>., <NAME>., <NAME>., <NAME>., & <NAME>. (2005). Kernel Methods for Measuring Independence. Journal of Machine Learning Research, 6, 2075–2129. HSIC statistic assuming given... | 2.233367 | 2 |
build/scripts/gen_py_protos.py | kevinyen-oath/catboost | 1 | 6629428 | <gh_stars>1-10
import os
from os import path
import shutil
import subprocess
import sys
import tempfile
OUT_DIR_ARG = '--python_out='
GRPC_OUT_DIR_ARG = '--grpc_py_out='
PB_PY_RENAMES = [
('_pb2_grpc.py', '__int___pb2_grpc.py'),
('_ev_pb2.py', '__int___ev_pb2.py'),
('_pb2.py', '__int___pb2.py')
]
def mai... | import os
from os import path
import shutil
import subprocess
import sys
import tempfile
OUT_DIR_ARG = '--python_out='
GRPC_OUT_DIR_ARG = '--grpc_py_out='
PB_PY_RENAMES = [
('_pb2_grpc.py', '__int___pb2_grpc.py'),
('_ev_pb2.py', '__int___ev_pb2.py'),
('_pb2.py', '__int___pb2.py')
]
def main(args):
ou... | none | 1 | 2.577244 | 3 | |
trump/converting/objects.py | Equitable/trump | 8 | 6629429 | # -*- coding: utf-8 -*-
import pandas as pd
import Quandl as qdl
from datetime import datetime as dt
def recip(t):
return t[1], t[0]
class CurPair(object):
def __init__(self, sym):
if len(sym) == 6:
self.num, self.den = sym[3:], sym[:3]
elif "//" in sym:
self.num, self... | # -*- coding: utf-8 -*-
import pandas as pd
import Quandl as qdl
from datetime import datetime as dt
def recip(t):
return t[1], t[0]
class CurPair(object):
def __init__(self, sym):
if len(sym) == 6:
self.num, self.den = sym[3:], sym[:3]
elif "//" in sym:
self.num, self... | en | 0.543735 | # -*- coding: utf-8 -*- #should be a tuple Use quandl data to build conversion table Use trump data to build conversion table symbols : list of symbols: will attempt to use units to build the conversion table, strings represent symbol names. Build conversion... | 2.74157 | 3 |
test/test_clustering.py | p123hx/scHiC-py | 15 | 6629430 | # -*- coding: utf-8 -*-
import pytest
import numpy as np
import sys
import os
sys.path.insert(0, os.path.abspath(
os.path.join(
os.path.dirname(__file__), '..')))
from scHiCTools import kmeans, spectral_clustering, HAC
center=np.array([[0,0],[100,100],[-100,100]])
rand_data = np.random.normal(size=(90,... | # -*- coding: utf-8 -*-
import pytest
import numpy as np
import sys
import os
sys.path.insert(0, os.path.abspath(
os.path.join(
os.path.dirname(__file__), '..')))
from scHiCTools import kmeans, spectral_clustering, HAC
center=np.array([[0,0],[100,100],[-100,100]])
rand_data = np.random.normal(size=(90,... | en | 0.769321 | # -*- coding: utf-8 -*- | 2.167541 | 2 |
buildpack/java.py | ernororive/cf-mendix-buildpack | 0 | 6629431 | import json
import logging
import os
import re
import subprocess
from buildpack import util
def compile(buildpack_path, cache_path, local_path, java_version):
logging.debug("begin download and install java")
util.mkdir_p(os.path.join(local_path, "bin"))
jvm_location = ensure_and_get_jvm(
java_ver... | import json
import logging
import os
import re
import subprocess
from buildpack import util
def compile(buildpack_path, cache_path, local_path, java_version):
logging.debug("begin download and install java")
util.mkdir_p(os.path.join(local_path, "bin"))
jvm_location = ensure_and_get_jvm(
java_ver... | en | 0.788516 | # create a symlink in .local/bin/java # use .. when jdk is in .local because absolute path # is different at staging time # update cacert file # override locale providers for java8 | 2.272029 | 2 |
ms_mint/peak_optimization/ManualRetentionTimeOptimizer.py | soerendip/ms-mint | 1 | 6629432 | import numpy as np
import pandas as pd
import ipywidgets as W
import plotly.express as px
from tqdm import tqdm
from IPython.display import display
from .io import ms_file_to_df
class ManualRetentionTimeOptimizer:
def __init__(self, mint):
self.df = pd.concat(
[ms_file_to_df(fn).assign(ms_... | import numpy as np
import pandas as pd
import ipywidgets as W
import plotly.express as px
from tqdm import tqdm
from IPython.display import display
from .io import ms_file_to_df
class ManualRetentionTimeOptimizer:
def __init__(self, mint):
self.df = pd.concat(
[ms_file_to_df(fn).assign(ms_... | none | 1 | 2.364289 | 2 | |
krmining/classification/__init__.py | SynitCool/keyar-mining | 2 | 6629433 | <gh_stars>1-10
from ._knn import KNearestNeighborsClassifier
from ._logistic_regression import LogisticRegression
__all__ = ["KNearestNeighborsClassifier", "LogisticRegression"]
| from ._knn import KNearestNeighborsClassifier
from ._logistic_regression import LogisticRegression
__all__ = ["KNearestNeighborsClassifier", "LogisticRegression"] | none | 1 | 1.174592 | 1 | |
pyosmo/end_conditions/base.py | OPpuolitaival/pyosmo | 7 | 6629434 | from abc import abstractmethod
from pyosmo.history.history import OsmoHistory
from pyosmo.model import OsmoModelCollector
class OsmoEndCondition:
"""
Abstract end condition class
"""
@abstractmethod
def end_test(self, history: OsmoHistory, model: OsmoModelCollector) -> bool:
raise Except... | from abc import abstractmethod
from pyosmo.history.history import OsmoHistory
from pyosmo.model import OsmoModelCollector
class OsmoEndCondition:
"""
Abstract end condition class
"""
@abstractmethod
def end_test(self, history: OsmoHistory, model: OsmoModelCollector) -> bool:
raise Except... | en | 0.600438 | Abstract end condition class | 2.859647 | 3 |
yt/data_objects/index_subobjects/grid_patch.py | lconaboy/yt | 0 | 6629435 | import warnings
import weakref
from typing import List, Tuple
import numpy as np
import yt.geometry.particle_deposit as particle_deposit
from yt.config import ytcfg
from yt.data_objects.selection_objects.data_selection_objects import (
YTSelectionContainer,
)
from yt.funcs import is_sequence
from yt.geometry.sele... | import warnings
import weakref
from typing import List, Tuple
import numpy as np
import yt.geometry.particle_deposit as particle_deposit
from yt.config import ytcfg
from yt.data_objects.selection_objects.data_selection_objects import (
YTSelectionContainer,
)
from yt.funcs import is_sequence
from yt.geometry.sele... | en | 0.865238 | Return the integer starting index for each dimension at the current level. This will attempt to convert a given unit to cgs from code units. It either returns the multiplicative factor or throws a KeyError. # So first we figure out what the index is. We don't assume # that dx=dy=dz, at least here. We ... | 1.813421 | 2 |
evap/evaluation/tests/test_models.py | JenniferStamm/EvaP | 0 | 6629436 | <filename>evap/evaluation/tests/test_models.py
from datetime import datetime, timedelta, date
from unittest.mock import patch, Mock
from django.test import TestCase, override_settings
from django.core.cache import cache
from django.core import mail
from model_mommy import mommy
from evap.evaluation.models import (Co... | <filename>evap/evaluation/tests/test_models.py
from datetime import datetime, timedelta, date
from unittest.mock import patch, Mock
from django.test import TestCase, override_settings
from django.core.cache import cache
from django.core import mail
from model_mommy import mommy
from evap.evaluation.models import (Co... | en | 0.915091 | # Course is "fully reviewed" as no open text_answers are present by default, # Course is "fully reviewed" and not graded, thus gets published immediately. # Course is out of evaluation period. # This course is not. Regression test for #945 # manually circumvent Course's save() method to have a Course without a general ... | 2.235442 | 2 |
tests/batch_fetch/test_many_to_one_relationships.py | jd/sqlalchemy-utils | 1 | 6629437 | import sqlalchemy as sa
from sqlalchemy_utils import batch_fetch
from tests import TestCase
class TestBatchFetchManyToOneRelationships(TestCase):
def create_models(self):
class User(self.Base):
__tablename__ = 'user'
id = sa.Column(sa.Integer, autoincrement=True, primary_key=True)
... | import sqlalchemy as sa
from sqlalchemy_utils import batch_fetch
from tests import TestCase
class TestBatchFetchManyToOneRelationships(TestCase):
def create_models(self):
class User(self.Base):
__tablename__ = 'user'
id = sa.Column(sa.Integer, autoincrement=True, primary_key=True)
... | en | 0.864555 | # no lazy load should occur # no lazy load should occur # no lazy load should occur | 2.59742 | 3 |
appdaemon/appdaemon.py | chipsi007/appdaemon | 0 | 6629438 | <filename>appdaemon/appdaemon.py
import sys
import importlib
import traceback
import os
import os.path
from queue import Queue
import datetime
import uuid
import astral
import pytz
import math
import asyncio
import yaml
import concurrent.futures
import threading
import random
import re
from copy import deepcopy, copy
i... | <filename>appdaemon/appdaemon.py
import sys
import importlib
import traceback
import os
import os.path
from queue import Queue
import datetime
import uuid
import astral
import pytz
import math
import asyncio
import yaml
import concurrent.futures
import threading
import random
import re
from copy import deepcopy, copy
i... | en | 0.761304 | # No locking yet # User Supplied/Defaults # Initialize config file tracking #if os.path.isdir(self.app_dir) is False: # self.log("ERROR", "Invalid value for app_dir: {}".format(self.app_dir)) # return # # Initial Setup # # Create Worker Threads # Load Plugins # # Not a custom plugin, assume it's a built in # # Cr... | 1.782441 | 2 |
main.py | KlaipedaBreeze/testAzureApi | 0 | 6629439 | from fastapi import FastAPI
import uvicorn
app = FastAPI()
@app.get("/")
def home():
return "Hello World"
| from fastapi import FastAPI
import uvicorn
app = FastAPI()
@app.get("/")
def home():
return "Hello World"
| none | 1 | 2.164208 | 2 | |
scripts/triangle_cuts.py | rekka/isosurface-rs | 0 | 6629440 | <filename>scripts/triangle_cuts.py
def recur(idx):
n = len(idx)
if len(idx) < 3:
print 'if u' + str(n) + ' >= 0. {'
if len(idx) < 2:
print ' let u' + str(n) + ' = u' + str(n) + ' + tiny;'
idx.append(0)
recur(idx)
idx.pop()
print('} else {')
... | <filename>scripts/triangle_cuts.py
def recur(idx):
n = len(idx)
if len(idx) < 3:
print 'if u' + str(n) + ' >= 0. {'
if len(idx) < 2:
print ' let u' + str(n) + ' = u' + str(n) + ' + tiny;'
idx.append(0)
recur(idx)
idx.pop()
print('} else {')
... | none | 1 | 2.899645 | 3 | |
PyMOTW/source/multiprocessing/multiprocessing_subclass.py | axetang/AxePython | 1 | 6629441 | #!/usr/bin/env python3
# encoding: utf-8
#
# Copyright (c) 2008 <NAME> All rights reserved.
#
"""Creating and waiting for a process
"""
#end_pymotw_header
import multiprocessing
class Worker(multiprocessing.Process):
def run(self):
print('In {}'.format(self.name))
return
if __name__ == '__main... | #!/usr/bin/env python3
# encoding: utf-8
#
# Copyright (c) 2008 <NAME> All rights reserved.
#
"""Creating and waiting for a process
"""
#end_pymotw_header
import multiprocessing
class Worker(multiprocessing.Process):
def run(self):
print('In {}'.format(self.name))
return
if __name__ == '__main... | en | 0.690029 | #!/usr/bin/env python3 # encoding: utf-8 # # Copyright (c) 2008 <NAME> All rights reserved. # Creating and waiting for a process #end_pymotw_header | 3.30199 | 3 |
locs/training/train_utils.py | mkofinas/locs | 16 | 6629442 | import os
import torch
from torch.utils.tensorboard import SummaryWriter
def build_scheduler(opt, params):
lr_decay_factor = params.get('lr_decay_factor')
lr_decay_steps = params.get('lr_decay_steps')
if lr_decay_factor:
return torch.optim.lr_scheduler.StepLR(opt, lr_decay_steps, lr_decay_factor)... | import os
import torch
from torch.utils.tensorboard import SummaryWriter
def build_scheduler(opt, params):
lr_decay_factor = params.get('lr_decay_factor')
lr_decay_steps = params.get('lr_decay_steps')
if lr_decay_factor:
return torch.optim.lr_scheduler.StepLR(opt, lr_decay_steps, lr_decay_factor)... | none | 1 | 2.285101 | 2 | |
evaluations/__init__.py | xialeiliu/GFR-IL | 34 | 6629443 | from __future__ import absolute_import
import utils
from .cnn import extract_cnn_feature, extract_cnn_feature_classification
from .extract_featrure import extract_features, pairwise_distance, pairwise_similarity, extract_features_classification
from .recall_at_k import Recall_at_ks, Recall_at_ks_products
from .NMI imp... | from __future__ import absolute_import
import utils
from .cnn import extract_cnn_feature, extract_cnn_feature_classification
from .extract_featrure import extract_features, pairwise_distance, pairwise_similarity, extract_features_classification
from .recall_at_k import Recall_at_ks, Recall_at_ks_products
from .NMI imp... | en | 0.522202 | # from utils import to_torch | 1.234147 | 1 |
src/run.py | Rocuku/python-stencil | 0 | 6629444 | <reponame>Rocuku/python-stencil
# coding: utf-8
from Table import Table
from Cell import Cell
import time, os
import sys
if __name__ == '__main__':
file_path = None
weight = 9
height = 9
time_slot = 1
for argv in sys.argv:
if argv[: 12] == "--file_path=":
file_path = argv[12:]
if argv[: 9] == "--height=":... | # coding: utf-8
from Table import Table
from Cell import Cell
import time, os
import sys
if __name__ == '__main__':
file_path = None
weight = 9
height = 9
time_slot = 1
for argv in sys.argv:
if argv[: 12] == "--file_path=":
file_path = argv[12:]
if argv[: 9] == "--height=":
height = int(argv[9:])
if ... | en | 0.833554 | # coding: utf-8 | 2.898852 | 3 |
kwctoolkit/base/generate_callback_impl.py | Kai-Wolf-SW-Consulting/KWCToolkit | 0 | 6629445 | <reponame>Kai-Wolf-SW-Consulting/KWCToolkit<filename>kwctoolkit/base/generate_callback_impl.py<gh_stars>0
#!/usr/bin/env python3
# Copyright (c) 2021, <NAME> - SW Consulting. All rights reserved.
# For the licensing terms see LICENSE file in the root directory. For the
# list of contributors see the AUTHORS file in the... | #!/usr/bin/env python3
# Copyright (c) 2021, <NAME> - SW Consulting. All rights reserved.
# For the licensing terms see LICENSE file in the root directory. For the
# list of contributors see the AUTHORS file in the same directory.
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
from abc import ABCMe... | en | 0.490997 | #!/usr/bin/env python3 # Copyright (c) 2021, <NAME> - SW Consulting. All rights reserved. # For the licensing terms see LICENSE file in the root directory. For the # list of contributors see the AUTHORS file in the same directory. Base class for generating different callback types Generate callback typename with suffix... | 2.666373 | 3 |
tests/test_suite.py | alexcwyu/python-trading | 17 | 6629446 | # add comment here
import unittest
from tests.test_bar import BarTest
from tests.test_bar_aggregator import BarAggregatorTest
from tests.test_broker import SimulatorTest
from tests.test_broker_mgr import BrokerManagerTest
from tests.test_clock import ClockTest
#from tests.test_cmp_functional_backtest import TestCompar... | # add comment here
import unittest
from tests.test_bar import BarTest
from tests.test_bar_aggregator import BarAggregatorTest
from tests.test_broker import SimulatorTest
from tests.test_broker_mgr import BrokerManagerTest
from tests.test_clock import ClockTest
#from tests.test_cmp_functional_backtest import TestCompar... | en | 0.125818 | # add comment here #from tests.test_cmp_functional_backtest import TestCompareWithFunctionalBacktest #from tests.test_pipeline import PipelineTest #from tests.test_pipeline_pairwise import PairwiseTest #test_suite.addTest(unittest.makeSuite(TestCompareWithFunctionalBacktest)) #test_suite.addTest(unittest.makeSuite(Pers... | 1.60944 | 2 |
example/try.py | zhenhua32/luke | 0 | 6629447 | import aiohttp
import asyncio
import async_timeout
async def get():
async with aiohttp.ClientSession() as session:
async with session.get('http://httpbin.org/get') as resp:
print(resp.status)
# print(await resp.content.read(10))
print(await resp.text())
loop = asyncio.... | import aiohttp
import asyncio
import async_timeout
async def get():
async with aiohttp.ClientSession() as session:
async with session.get('http://httpbin.org/get') as resp:
print(resp.status)
# print(await resp.content.read(10))
print(await resp.text())
loop = asyncio.... | en | 0.15861 | # print(await resp.content.read(10)) | 2.975495 | 3 |
tests/test_organized_coronavirus_info.py | QMSS-G5072-2020/final_project_li_ruiqi | 0 | 6629448 | from organized_coronavirus_info import __version__
from organized_coronavirus_info import organized_coronavirus_info
import pandas as pd
import matplotlib.pyplot as plt
import requests
import json
def test_version():
assert __version__ == '0.1.0'
historical_data = organized_coronavirus_info.obtain_historical_data... | from organized_coronavirus_info import __version__
from organized_coronavirus_info import organized_coronavirus_info
import pandas as pd
import matplotlib.pyplot as plt
import requests
import json
def test_version():
assert __version__ == '0.1.0'
historical_data = organized_coronavirus_info.obtain_historical_data... | en | 0.747042 | # Adding unit test corresponding to functions in package # For functions in part 1 # For functions in part 2 | 2.647848 | 3 |
swampymud/item.py | ufosc/MuddySwamp | 10 | 6629449 | '''
This module provides base classes for Items.
item.Item acts as a base class for all items. Besides providing a few
skeletal methods to help with serialization and user interaction, this
class is relatively straightforward.
item.Usable is an abstract class used for checking ItemClasses. A
developer may create a 'Us... | '''
This module provides base classes for Items.
item.Item acts as a base class for all items. Besides providing a few
skeletal methods to help with serialization and user interaction, this
class is relatively straightforward.
item.Usable is an abstract class used for checking ItemClasses. A
developer may create a 'Us... | en | 0.828205 | This module provides base classes for Items. item.Item acts as a base class for all items. Besides providing a few skeletal methods to help with serialization and user interaction, this class is relatively straightforward. item.Usable is an abstract class used for checking ItemClasses. A developer may create a 'Usable... | 3.20565 | 3 |
modules/users/domain/services/create_user_service.py | eduardolujan/hexagonal_architecture_django | 6 | 6629450 | # -*- coding: utf-8 -*-
from modules.users.domain.entities import User as UserEntity
from modules.users.domain.domain_events import CreateUserDomainEvent
from modules.users.domain.value_objects import (UserId,
Username,
Pa... | # -*- coding: utf-8 -*-
from modules.users.domain.entities import User as UserEntity
from modules.users.domain.domain_events import CreateUserDomainEvent
from modules.users.domain.value_objects import (UserId,
Username,
Pa... | en | 0.822542 | # -*- coding: utf-8 -*- Create user entities | 2.720487 | 3 |