max_stars_repo_path stringlengths 3 269 | max_stars_repo_name stringlengths 4 119 | max_stars_count int64 0 191k | id stringlengths 1 7 | content stringlengths 6 1.05M | score float64 0.23 5.13 | int_score int64 0 5 |
|---|---|---|---|---|---|---|
gbpservice/contrib/tests/unit/nfp/configurator/agents/test_firewall.py | ansao-aci/group-based-policy | 0 | 25200 | # 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
# d... | 1.859375 | 2 |
deepchem/data/test_data_loader.py | n3011/deepchem | 2 | 25201 | <reponame>n3011/deepchem
import os
from unittest import TestCase
from io import StringIO
import tempfile
import shutil
import deepchem as dc
class TestCSVLoader(TestCase):
def test_load_singleton_csv(self):
fin = tempfile.NamedTemporaryFile(mode='w', delete=False)
fin.write("smiles,endpoint\nc1ccccc1,1")
... | 2.59375 | 3 |
fiwareglancesync/glancesync_serverfacade_mock.py | telefonicaid/fiware-glancesync | 0 | 25202 | #!/usr/bin/env python
# -- encoding: utf-8 --
#
# Copyright 2015-2016 Telefónica Investigación y Desarrollo, S.A.U
#
# This file is part of FI-WARE project.
#
# 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... | 1.820313 | 2 |
0867_transpose_matrix/python_source.py | arthurdysart/LeetCode | 0 | 25203 | # -*- coding: utf-8 -*-
"""
Leetcode - Transpose Matrix
https://leetcode.com/problems/transpose-matrix
Created on Fri Nov 23 11:13:48 2018
@author: <NAME>
"""
## REQUIRED MODULES
import sys
## MODULE DEFINITIONS
class Solution:
"""
Iteration over all elements of 2D array.
Time compl... | 4.15625 | 4 |
src/test/aiml_tests/pattern_set_tests/test_pattern_set_aiml.py | narnikgamarnikus/program-y | 0 | 25204 | <gh_stars>0
import unittest
import os
from test.aiml_tests.client import TestClient
from programy.config.sections.brain.file import BrainFileConfiguration
class BasicTestClient(TestClient):
def __init__(self):
TestClient.__init__(self)
def load_configuration(self, arguments):
super(BasicTestC... | 2.734375 | 3 |
Python/erect-the-fence.py | RideGreg/LeetCode | 1 | 25205 | <gh_stars>1-10
# Time: O(nlogn)
# Space: O(n)
# There are some trees, where each tree is represented by
# (x,y) coordinate in a two-dimensional garden.
# Your job is to fence the entire garden using the minimum length of rope
# as it is expensive. The garden is well fenced only if all the trees are enclosed.
# Your t... | 3.6875 | 4 |
clase 1/quiz 1/quiz 1 exe.py | amedina14/uip-iq17-pc3 | 0 | 25206 | <reponame>amedina14/uip-iq17-pc3
'''
Quiz 1:
Hacer un programa que lea una temperatura en farenheit y la convierta en celsius y si es mayor
a 100°C imprima "caliente". Si es menor a 0°C imprima "frio"
'''
tempF = int(input("TempF: "))
#(tempF - 32/(5/9))
tempC = (((tempF - 32)*5)/9)
print("\nLa temperatur... | 3.75 | 4 |
config.py | retry0/botTelegram-nCov | 0 | 25207 | <filename>config.py
api_key = "<KEY>"
| 1.125 | 1 |
aws-computation.py | juhi04/CodeDeployGitHubDemo | 0 | 25208 | <filename>aws-computation.py
import pandas as pd
import redis
def create_dummy_df():
print("Redis imported")
df = pd.DataFrame({'A': [1, 2, 3], 'B': [5, 10, 15]})
print(df)
return df
if __name__=='__main__':
try:
while True:
df = create_dummy_df()
except (KeyboardInterrup... | 2.578125 | 3 |
botpubg-mpgh/SuperBot.py | fuckpubg/AHK | 58 | 25209 | # -*- coding: utf-8 -*-
import json
import os
import time
import psutil
import pyautogui
pubg_url = 'steam://rungameid/578080'
PROCNAME = "TslGame.exe"
CRASH_PROCNAME = "BroCrashReporter.exe"
debug_directory = "debug_screenshots"
start_state = "HELLO"
play_state = "PLAYING"
play_timer_max = 60 * 3
matching_state = ... | 2.546875 | 3 |
mailcheker.py | yamamototakas/mailChecker | 0 | 25210 | #! C:\bin\Python35\python.exe
# -*- coding: utf-8 -*-
'''
Modified for python3 on 2012/04/29
original python2 version is Created on 2011/10/30
@author: tyama
'''
import poplib
import email.header
import string
import re
import urllib.request
import urllib.error
import urllib.parse
import http.cookiejar
import socket
... | 2.421875 | 2 |
tests/epc_schemes/test_giai.py | nedap/retail-epcpy | 2 | 25211 | <gh_stars>1-10
import unittest
from epcpy.epc_schemes.giai import GIAI, GIAIFilterValue
from tests.epc_schemes.test_base_scheme import (
TestEPCSchemeInitMeta,
TestGS1ElementMeta,
TestTagEncodableMeta,
)
class TestGIAIInit(
unittest.TestCase,
metaclass=TestEPCSchemeInitMeta,
scheme=GIAI,
... | 1.992188 | 2 |
tests/conftest.py | olist/olist-loafer | 11 | 25212 | <filename>tests/conftest.py
import pytest
from loafer.providers import AbstractProvider
@pytest.fixture
def dummy_handler():
def handler(message, *args):
raise AssertionError("I should not be called")
return handler
@pytest.fixture
def dummy_provider():
class Dummy(AbstractProvider):
a... | 2.40625 | 2 |
setup.py | anderct105/Dataset_python | 0 | 25213 | from setuptools import setup
setup(
name='dataset',
version='0.0.1',
author='<NAME>',
author_email='<EMAIL>',
packages=['dataset'],
url='Indicar una URL para el paquete...',
license='LICENSE.txt',
description='This package includes some basic functions to work with a dataset object',
long_de... | 1.382813 | 1 |
install/services/event.py | philipcwhite/monitoring2 | 10 | 25214 | <reponame>philipcwhite/monitoring2<filename>install/services/event.py
import datetime, configparser, os, smtplib, time, pymysql.cursors
from email.message import EmailMessage
class EventSettings:
app_path = './'
availability_check = 300
availability_severity = 1
agent_retention = 2592000
data_reten... | 2.296875 | 2 |
publicacion/migrations/0002_remove_publicacion_user_publicacion_autor_and_more.py | chelocastillo1/test | 1 | 25215 | <gh_stars>1-10
# Generated by Django 4.0 on 2021-12-15 02:51
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('cuenta', '0001_initial'),
('publicacion', '0001_initial'),
]
operations = [
migrations... | 1.65625 | 2 |
databricks/koalas/missing/window.py | HG1112/koalas | 1 | 25216 | <reponame>HG1112/koalas
#
# Copyright (C) 2019 Databricks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 2.03125 | 2 |
task/bq2bq/executor/bumblebee/loader.py | pikochip/transformers | 34 | 25217 | from bumblebee.bigquery_service import BigqueryService
from datetime import datetime
from abc import ABC
from abc import abstractmethod
from bumblebee.config import LoadMethod
class BaseLoader(ABC):
@abstractmethod
def load(self, query):
pass
class PartitionLoader(BaseLoader):
def __init__(sel... | 2.828125 | 3 |
Servus/home/urls.py | sug4rok/Servus | 0 | 25218 | <reponame>sug4rok/Servus
# coding=utf-8
from django.conf.urls import url
from .views import home, positioned, tiled
urlpatterns = [
url(r'^$', home),
url(r'home/$', home),
url(r'positioned-(?P<plan_id>[0-9]{1,4})/$', positioned),
url(r'tiled/$', tiled),
]
| 1.445313 | 1 |
app/API/read.py | blagisquet/testNautilux | 0 | 25219 | import mysql.connector
from mysql.connector import Error
try:
# connection au serveur mysql database interventions
connection = mysql.connector.connect(host='localhost',
database='interventions',
user='root')
# SELECT la totalité de la... | 3.046875 | 3 |
2_CS_Medium/Leetcode/Interview_Easy/DLC_9_Other.py | andremichalowski/CSN1 | 0 | 25220 | <filename>2_CS_Medium/Leetcode/Interview_Easy/DLC_9_Other.py
1. Number of 1 Bits (HammingWeight):
https://leetcode.com/explore/interview/card/top-interview-questions-easy/99/others/565/
# Easy way
def hammingWeight(self, n: int) -> int:
return bin(n).count('1')
# Harder way - https://stackoverflow.... | 3.875 | 4 |
scripts/fitter/pcl_fitter.py | yuki-inaho/zense_grpc_rgbd_ir | 0 | 25221 |
import math
from math import pi
import numpy as np
import open3d as o3d
import matplotlib.pyplot as plt
import cv2
import toml
from .cameraparam import CameraParam
from .fitted_line import FittedLine
from .ransac_fit import ransac_line_fit, ransac_ground_fit
from .util import check_all_false
# TODO: output random s... | 2.1875 | 2 |
parsnip/exceptions.py | timmyomahony/python-parsnip | 2 | 25222 | class ParsnipException(Exception):
def __init__(self, msg, webtexter=None):
self.args = (msg, webtexter)
self.msg = msg
self.webtexter = webtexter
def __str__(self):
return repr("[%s] %s - %s" % (self.webtexter.NETWORK_NAME, self.webtexter.phone_number, self.msg))
class LoginError(ParsnipException):pa... | 2.8125 | 3 |
dataschema/schema2sql.py | NunaInc/sql_tools | 1 | 25223 | <reponame>NunaInc/sql_tools
#
# nuna_sql_tools: Copyright 2022 Nuna Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | 1.835938 | 2 |
fca/algorithms/incremental.py | ksiomelo/cubix | 3 | 25224 | <filename>fca/algorithms/incremental.py
# -*- coding: utf-8 -*-
"""Holds implementation of Norris' algorithm"""
from copy import copy
from fca import Concept, ConceptSystem,ConceptLink
#from fca.algorithms.incremental import derivation
def add_object(object, intent, lattice):
sup_g = lattice.get_bottom_conc... | 2.453125 | 2 |
adaptive/tests/test_pickling.py | AlvaroGI/adaptive | 0 | 25225 | <filename>adaptive/tests/test_pickling.py
import pickle
import pytest
from adaptive.learner import (
AverageLearner,
BalancingLearner,
DataSaver,
IntegratorLearner,
Learner1D,
Learner2D,
SequenceLearner,
)
from adaptive.runner import simple
try:
import cloudpickle
with_cloudpickl... | 2.390625 | 2 |
demo/worlddata/migrations/0005_foods_hunger.py | MarsZone/DreamLand | 0 | 25226 | <filename>demo/worlddata/migrations/0005_foods_hunger.py
# -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2017-07-06 08:03
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('worlddata', '0004_auto_20170628_155... | 1.476563 | 1 |
woodstock/auth_backends.py | allink/woodstock | 0 | 25227 | <gh_stars>0
from woodstock.models import Invitee, Participant
from woodstock import settings
from django.core.exceptions import ObjectDoesNotExist
class PersonBackend(object):
supports_object_permissions = False
supports_anonymous_user = False
supports_inactive_user = False
def authenticate(self, use... | 2.3125 | 2 |
Python_Orientacao_Objeto/teste2.py | carlosrjhoe/Python | 0 | 25228 | <reponame>carlosrjhoe/Python<gh_stars>0
def soma(x,y):
return print(x + y)
def sub(x,y):
return print(x - y)
def mult(x,y):
return print(x * y)
def div(x,y):
return print(x / y)
soma(3,8)
sub(10,5)
mult(3,9)
div(15,7) | 3.328125 | 3 |
Greedy/HuffmanCompression.py | Jh123x/COMP-550-Algorithms-and-Analysis | 0 | 25229 | <gh_stars>0
from math import log2
import time
from typing import Optional
from heapq import heapify, heappush, heappop
class Node(object):
def __init__(self, freq: int, value: Optional[str] = None, left: 'Node' = None, right: 'Node' = None) -> None:
"""Node object for representing the huffman tree"""
... | 3.46875 | 3 |
practice11.py | ikramulkayes/Python_season2 | 0 | 25230 |
import turtle as t
import time
import os #connected with practice10.py
path = 'F:\\Github\\Python_season2'
os.chdir(path)
from practice10 import Snake
from practice13 import Food
from practice14 import Score
screen = t.Screen()
screen.setup(width=600,height=600)
screen.bgcolor("black")
screen.title("My snake"... | 2.859375 | 3 |
Maths/__init__.py | NextLmabda/PyLambda | 0 | 25231 | print('Omolewa is teaching a class')
print('Lanre is still making changes')
print('Omolewa has made a change too')
| 1.71875 | 2 |
preprocessing_danych/dataset_config.py | MaciejKonieczka/gazspot-prediction | 0 | 25232 | <gh_stars>0
test_index = ("2019-05-01", "2020-04-30")
train_index = ("2016-01-02", "2019-04-30")
val_index = ("2018-10-01", "2019-04-30")
| 1.328125 | 1 |
deployutils/apps/django/backends/jwt_session_store.py | knivets/djaodjin-deployutils | 0 | 25233 | <filename>deployutils/apps/django/backends/jwt_session_store.py
# Copyright (c) 2018, DjaoDjin inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retai... | 1.507813 | 2 |
gnumber/game.py | robin-pt/learning_note_pyGuessNumber | 0 | 25234 | <gh_stars>0
""" handle game's room """
import uuid
from django_redis import get_redis_connection
from . import rules
def roomExist(roomID):
""" retun true if room is exist """
conn = get_redis_connection("games")
result = conn.exists(roomID)
del conn
return result
def create(userID):... | 2.546875 | 3 |
muscles/neo4j/read_py2neo.py | Spanarchian/measure_group | 0 | 25235 |
from py2neo import Graph
grapher = Graph("bolt://localhost:7687", auth=("neo4j", "changeme"))
x = grapher.run("MATCH (a :Person) RETURN a.name, a.city, a.age").to_data_frame()
print(f"To_data_frame() :\n{x}")
| 2.8125 | 3 |
core/levels/thunder/a2finance/a2finance.py | wwu-pdx/web-ctf | 0 | 25236 | import random
import os
import subprocess
import shutil
from google.cloud import storage, logging as glogging
from core.framework import levels
from core.framework.cloudhelpers import deployments, iam, gcstorage, ssh_keys
LEVEL_PATH = 'thunder/a2finance'
RESOURCE_PREFIX = 'a2'
LOG_NAME = 'transactions'
def create(... | 2.15625 | 2 |
train.py | R4j4n/Travelling-salesman-problem-using-Genetic-Algorimthm | 4 | 25237 | <reponame>R4j4n/Travelling-salesman-problem-using-Genetic-Algorimthm
import numpy as np
from environment import Environment
#~~~~~~~~CREATING THE BOTS~~~~~~~~~
class Route():
def __init__(self, dnaLength):
# dnaLength = num of planets........
self.dnaLength = dnaLength
self.d... | 3.21875 | 3 |
PerFrameObjectDetector.py | SunBangjie/smartphone_pairing | 0 | 25238 | import cv2
import os
from os import listdir, makedirs
from os.path import isfile, join, exists
import numpy as np
import time
import math
DEBUG = True
FACTOR = 2
RESO_X = int(576 / FACTOR)
RESO_Y = int(640 / FACTOR)
CONF_VAL = 0
THRESHOLD = 0
UPPER_BOUND = 230
LOWER_BOUND = 150
def get_file_index(filename):
i... | 2.71875 | 3 |
example/nsls2id.py | NSLS-II/aphla | 0 | 25239 | <filename>example/nsls2id.py
"""
NSLS-II insertion device commissioning/operation
copyright (C) 2014, <NAME>, <NAME>, <NAME>
"""
import aphla as ap
import itertools
import numpy as np
import re
import h5py
_params = {
"dw100g1c08u":
{"unitsys": "phy",
"gap": (119.0, 147.0, 30, 0.1),
"cc... | 2.203125 | 2 |
Tests/DimensionService.py | lapstue/tm1py | 0 | 25240 | import configparser
import unittest
from pathlib import Path
from TM1py.Objects import Dimension, Hierarchy, Element
from TM1py.Objects import ElementAttribute
from TM1py.Services import TM1Service
class TestDimensionService(unittest.TestCase):
@classmethod
def setUpClass(cls):
"""
Establish... | 2.453125 | 2 |
tests/test_version.py | datatags/pyCraft | 759 | 25241 | from distutils.version import StrictVersion as SV
import unittest
import minecraft
class VersionTest(unittest.TestCase):
def test_module_version_is_a_valid_pep_386_strict_version(self):
SV(minecraft.__version__)
def test_protocol_version_is_an_int(self):
for version in minecraft.SUPPORTED_PR... | 2.609375 | 3 |
td3/Twin_Delayed_DDPG/policy_network.py | Gregory-Eales/ml-reimplementations | 1 | 25242 | import torch
from torch.nn import functional as F
from torch import optim
from torch import nn
class PolicyNetwork(torch.nn.Module):
def __init__(self, in_dim, out_dim, alpha=0.01):
super(PolicyNetwork, self).__init__()
self.in_dim = in_dim
self.out_dim = out_dim
self.l1 = nn.Linear(in_dim, 128)
self.l2... | 2.609375 | 3 |
MoodyBeatsRecommenderAPI/api/serializers.py | labs12-music-stream-selector/DS | 0 | 25243 | <reponame>labs12-music-stream-selector/DS
from rest_framework import serializers
from songs.models import (
Song,
Tag,
NewVideo,
NewComment,
NewVideoTag,
NewVideoStats,
NewVideoCorrectMood,
)
class NewVideoStatsSerializer(serializers.ModelSerializer):
new_video = serializers.StringRelatedField()
class Meta:
... | 2.28125 | 2 |
lab/migrations/0003_auto_20191202_1534.py | jtdub/prod2lab | 11 | 25244 | <filename>lab/migrations/0003_auto_20191202_1534.py
# Generated by Django 2.2.8 on 2019-12-02 15:34
from django.db import migrations, models
import django.db.models.deletion
from lab.models import OperatingSystem
def initial_os_data(app, schema_editor):
data = [
{"os": "ios", "os_type": "cisco_ios", "ter... | 1.773438 | 2 |
org.cohorte.eclipse.runner.basic/files/test/cohorte/composer/top/criteria/distance/configuration.py | isandlaTech/cohorte-devtools | 1 | 25245 | <reponame>isandlaTech/cohorte-devtools
#!/usr/bin/env python
# -- Content-Encoding: UTF-8 --
"""
Top Composer: Group by configuration
:author: <NAME>
:license: Apache Software License 2.0
:version: 3.0.0
..
This file is part of Cohorte.
Cohorte is free software: you can redistribute it and/or modify
it ... | 1.039063 | 1 |
hask3/lang/lazylist.py | mvaled/hask | 7 | 25246 | <reponame>mvaled/hask
from collections import Sequence
from hask3.hack import objectify
from hask3.lang.type_system import Typeclass
from hask3.lang.type_system import Hask
from hask3.lang.typeclasses import Show
from hask3.lang.typeclasses import Eq
from hask3.lang.typeclasses import Ord
from hask3.lang.syntax import ... | 2.859375 | 3 |
code/test_dropout.py | lisa-1010/smart-tutor | 20 | 25247 |
# coding: utf-8
# # Using Dropout
# Let's see how we can use dropout for early stopping
from concept_dependency_graph import ConceptDependencyGraph
import data_generator as dg
from student import *
import simple_mdp as sm
import dynamics_model_class as dmc
import numpy as np
import dataset_utils
import tensorflow a... | 2.578125 | 3 |
deep_disfluency/corpus/tree_pos_map_writer.py | askender/deep_disfluency | 0 | 25248 | <reponame>askender/deep_disfluency
# -*- coding: utf-8 -*-
from collections import defaultdict
import re
from nltk import tree
from swda import CorpusReader
from tree_pos_map import TreeMapCorpus
from tree_pos_map import POSMapCorpus
possibleMistranscription = [("its", "it's"),
("Its", "It... | 2.203125 | 2 |
account_ux/wizards/account_invoice_tax_wizard.py | odoo-mastercore/odoo-argentina | 1 | 25249 | ##############################################################################
# For copyright and license notices, see __manifest__.py file in module root
# directory
##############################################################################
from odoo import models, fields, api
class AccountInvoiceTaxWizard(mode... | 1.742188 | 2 |
dslogparser/dslogparser.py | brettle/dslogparser | 0 | 25250 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Parse the FRC drive station logs which are packed binary data
# Notes on comparison to DSLog-Parse:
# D-P has packet_loss as a *signed* integer, which makes no sense. Unsigned looks sensible.
import datetime
import math
import re
import struct
import bitstring
MAX_... | 2.4375 | 2 |
app/define/views.py | alejandro-mosso/language-service | 0 | 25251 | <reponame>alejandro-mosso/language-service
from rest_framework.views import APIView
from rest_framework import status
from django.http import JsonResponse
from .services import DefineService
from .serializers import DefineSerializer
class DefineApiView(APIView):
service = DefineService()
"""
$ curl "htt... | 2.453125 | 2 |
tango_shared/settings.py | doismellburning/tango-shared-core | 0 | 25252 | <gh_stars>0
import django.conf.global_settings as DEFAULT_SETTINGS
### Tango-unique settings
# Thumbnail aliases determines default image sizes for easy-thumbnails
THUMBNAIL_ALIASES = {
'': {
'thumb': {'size': (50, 50), 'autocrop': True, 'crop': 'smart', 'upscale': True},
'one_col': ... | 1.578125 | 2 |
examples/mini_site/steps/stale_steps.py | xrg/behave_manners | 3 | 25253 | # -*- coding: UTF-8 -*-
from __future__ import print_function
from behave import given, when, then, step
from behave_manners.pagelems import DOMScope
from behave_manners.action_chains import ActionChains
from selenium.webdriver.common.keys import Keys
@when(u'I click to have the dropdown visible')
def click_dropdown1... | 2.546875 | 3 |
django_sendfile/utils.py | ParikhKadam/django-sendfile2 | 46 | 25254 | <filename>django_sendfile/utils.py
from functools import lru_cache
from importlib import import_module
from mimetypes import guess_type
from pathlib import Path, PurePath
from urllib.parse import quote, quote_plus
import logging
import unicodedata
from django.conf import settings
from django.core.exceptions import Imp... | 2.125 | 2 |
core/cmake_gens/tmake_cmake_generator_mac.py | tomken/tmake | 2 | 25255 | <filename>core/cmake_gens/tmake_cmake_generator_mac.py
#!/usr/bin/python
# -*- coding: UTF-8 -*-
"""cmake generator mac file"""
import os
import core
from core.info.tmake_builtin import tmake_path
from .tmake_cmake_generator import CMakeGenerator, CMakeSourceItem
PLUGIN_VERSION = "1.0.0"
CMAKE_IOS_RESOURCE_TEMPLATE... | 1.96875 | 2 |
students/models.py | estudeplus/perfil | 0 | 25256 | <reponame>estudeplus/perfil
from django.db import models
class Student(models.Model):
name = models.CharField(max_length=100)
student_id = models.CharField(max_length=10)
email = models.EmailField(max_length=254)
password = models.CharField(max_length=15)
def __str__(self):
return self.nam... | 2.34375 | 2 |
essentials/oo-programming/device_log.py | iomegak12/intel-training-usecase-1 | 0 | 25257 | class DeviceLog:
def __init__(self, deviceId, deviceName, temperature, location, recordDate):
self.deviceId = deviceId
self.deviceName = deviceName
self.temperature = temperature
self.location = location
self.recordDate = recordDate
def getStatus(self):
if self.t... | 3.546875 | 4 |
tigerline/management/commands/load_counties.py | adamfast/geodjango-tigerline | 11 | 25258 | import datetime
import os
import sys
from optparse import make_option
from django.core.management.base import BaseCommand
from django.conf import settings
try:
from django.contrib.gis.utils import LayerMapping
except ImportError:
print("gdal is required")
sys.exit(1)
from tigerline.models import County
... | 2.1875 | 2 |
nitorch/tools/registration/utils.py | balbasty/nitorch | 46 | 25259 | <reponame>balbasty/nitorch
"""Utility functions for registration algorithms.
Some (jg, jhj, affine_grid_backward) should maybe be moved to the `spatial`
module (?).
"""
from nitorch.core import py, utils, linalg
from nitorch import spatial
import torch
from . import optim as optm
def defaults_velocity(prm=None):
... | 1.945313 | 2 |
utils/The_Alchemist_Code/conceptcard.py | heboric/ouro | 3 | 25260 | <reponame>heboric/ouro
from ._main import DIRS,LinkDB,ConvertFields,StrBuff,StrCondition,Embed, Rarity,GitLabLink
import copy
def Conceptcard(iname, page):
#get card dir
card=DIRS['Conceptcard'][iname]
#create basic embed
embed= Embed(
title='', #page name
url=LinkDB('card',iname,'',True,'jp') #page link
)
... | 2.234375 | 2 |
xdagtool/xdu_test.py | rulerson/xdagtool | 0 | 25261 | <filename>xdagtool/xdu_test.py<gh_stars>0
import uuid, os
from pathlib import Path
from xdagtool import xdu
class TestPathCopy:
def test_file_copy1(self, tmp_path: Path, capsys):
# file a
srcpath = tmp_path / 'srcpath-{}'.format(uuid.uuid4())
destpath = tmp_path / 'destpath-{}'.format(uuid... | 2.5 | 2 |
rnaseq.py | albertoriva/pipelines | 0 | 25262 | <filename>rnaseq.py
# DibigActor
# (c) 2015, <NAME>, DiBiG
# RNAseq processing pipeline, v2.0
from SampleCollection import SampleCollection
from Logger import Logger
from Director import Director
D = Director(ACT)
## Initialization
ACT.loadConfiguration(ACT.Arguments[0])
ACT.bt2idx = ACT.getConf("bt2idx")
ACT.star... | 2.25 | 2 |
base/NeighborResult.py | Holly-Jiang/QCTSA | 0 | 25263 | <reponame>Holly-Jiang/QCTSA
class NeighborResult:
def __init__(self):
self.solutions = []
self.choose_path = []
self.current_num = 0
self.curr_solved_gates = []
| 2.234375 | 2 |
src/models/sequence_predictor_model.py | rajatdiptabiswas/NN_compression | 211 | 25264 | from __future__ import print_function
import os
import time
import tensorflow as tf
import numpy as np
import sys
from zoneout_wrapper import ZoneoutWrapper
class SequencePredictor():
def add_placeholders(self):
"""Generates placeholder variables to represent the input tensors
"""
self.inp... | 2.90625 | 3 |
machine/EventCase.py | technosvitman/sm_gene | 0 | 25265 |
'''
@brief this class reflect action decision regarding condition
'''
class EventAction():
'''
@brief build event action
@param cond the conditions to perform the action
@param to the target state if any
@param job the job to do if any
'''
def __init__(self, cond="", to=... | 2.828125 | 3 |
tests/test_utils.py | initOS/dob-lib | 0 | 25266 | <gh_stars>0
# © 2021 <NAME> (initOS GmbH)
# License Apache-2.0 (http://www.apache.org/licenses/).
import argparse
from unittest.mock import patch
import pytest
from doblib import utils
def test_merge():
assert utils.merge([1, 2], [3, 4]) == [1, 2, 3, 4]
assert utils.merge({1, 2}, {3, 4}) == {1, 2, 3, 4}
... | 2.21875 | 2 |
quedex_api/keys.py | mchalapuk/python-api | 17 | 25267 | <reponame>mchalapuk/python-api
quedex_public_key = """-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1
<KEY>
<KEY>
-----END PGP PUBLIC KEY BLOCK-----"""
| 1.171875 | 1 |
main.py | Habejota/Osys2 | 0 | 25268 | # Importando as dependencias
from os import system, chdir, mkdir, rmdir
from time import sleep
from socket import gethostname, gethostbyname
# Informações
__version__ = "1.0"
__tag_version__ = "Osys2 Beta"
# Ethernet and Socket informations
hostname = gethostname()
host = gethostbyname(hostname)
# Modulos e funções ... | 2.78125 | 3 |
src/mybot_pkg/scripts/imu_pub.py | leytpapas/thesis_project | 0 | 25269 | <filename>src/mybot_pkg/scripts/imu_pub.py
#!/usr/bin/env python3
import rospy
import sys
from sensor_msgs.msg import Imu, Temperature
from geometry_msgs.msg import Pose
from tf.transformations import quaternion_from_euler
from math import radians
import serial
import subprocess
class Imu_unit(object):
def __ini... | 2.15625 | 2 |
Timbuchalka/Section-4/conditions.py | Advik-B/Learn-Python | 6 | 25270 | age = int(input("How old are you ?"))
#if age >= 16 and age <= 65:
#if 16 <= age <= 65:
if age in range(16,66):
print ("Have a good day at work.")
elif age > 100 or age <= 0:
print ("Nice Try. This program is not dumb.")
endkey = input ("Press enter to exit")
else:
print (f"Enjoy your free time, ... | 3.953125 | 4 |
agents/fundamentalist.py | anthonyozerov/market-des | 0 | 25271 | <filename>agents/fundamentalist.py
import sys
sys.path.append('..')
from agent import Agent
from probability import Probability
import copy
import data
from random import sample
import numpy as np
class Trader(Agent):
def init_params(self,params):
self.next_trades = [0, 0, 0, 0]
self.belief_state ... | 2.921875 | 3 |
examples/src/python/misc/__init__.py | ajorgensen/heron | 2 | 25272 | <reponame>ajorgensen/heron<gh_stars>1-10
"""Miscellaneous example topology-related modules"""
__all__ = ['test_task_hook']
from .test_task_hook import TestTaskHook
| 0.71875 | 1 |
src/banditplot.py | schmit/human_interaction | 4 | 25273 | import numpy as np
import toyplot as tp
from banditutil import create_running_ema
def selection_emas(simulation_output, alpha=0.99):
k = simulation_output["k"]
rema = create_running_ema(alpha, initial=1/k)
return [rema((a == i for a in simulation_output["selection"]), return_list=True)
for i i... | 2.703125 | 3 |
tests/test_reducer.py | nclarey/pyg-base | 0 | 25274 | from pyg_base import reducer, reducing, dictable
import pytest
from operator import add, mul
from functools import reduce
def test_reducer():
assert reducer(add, [1,2,3,4]) == 10
assert reducer(mul, [1,2,3,4]) == 24
assert reducer(add, [1]) == 1
assert reducer(add, []) is None
with pytest.... | 2.71875 | 3 |
newsapp/scraper/parser.py | atahanyorganci/dailyspokesman | 0 | 25275 | from datetime import datetime
from typing import Any
from yarl import URL
from newsapp.config import Config
from newsapp.models.article import Article
from newsapp.scraper import NewsItem, ScrapeError, scrape
def get_category_url(category: str) -> URL:
category_path = Config.CATEGORIES[category]["url... | 2.625 | 3 |
programmingz3/code/subterm_simplify.py | Z3Prover/doc | 21 | 25276 | from z3 import *
H = Int('H')
s = Solver()
t = 4 + 4 * (((H - 1) / 2) / 2)
s.add(H % 4 == 0)
s.check()
m = s.model()
def subterms(t):
seen = {}
def subterms_rec(t):
if is_app(t):
for ch in t.children():
if ch in seen:
continue
seen[ch] = ... | 2.625 | 3 |
packages/robot/odahuflow/robot/libraries/sdk_wrapper.py | odahu/odahuflow | 0 | 25277 | <filename>packages/robot/odahuflow/robot/libraries/sdk_wrapper.py
# for class Model
import json
from odahuflow.sdk import config
from odahuflow.sdk.clients.api_aggregated import parse_resources_file_with_one_item
from odahuflow.sdk.clients.configuration import ConfigurationClient
from odahuflow.sdk.clients.connection ... | 1.984375 | 2 |
src/lh/service_directives.py | Plazmaz/LiquidHoney | 20 | 25278 | from abc import ABC
class ProbeConfig(object):
def __init__(self):
self.directives = {}
def add_directive(self, directive):
name = directive.keyword
if name not in self.directives:
self.directives[name] = []
self.directives[name].append(directive)
def get_dire... | 3.125 | 3 |
Dnaml.py | williamdlees/BioTools | 0 | 25279 | # Copyright (c) 2015 <NAME>
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sub... | 2.09375 | 2 |
gaia_project/communication_layer.py | yogurt-company/gaia_ai | 0 | 25280 | from traits.api import (HasPrivateTraits, Instance, List, Dict)
from .player import Player
from .board import GameBoard
from .tech_board import TechBoard
from gaia_project.faction_board.player_panel import PlayerPanel
from .layout import Layout
from .constants import BASIC_4P_SETUP
import pygame
import sys
class C... | 2.390625 | 2 |
dialogue-engine/test/programytest/security/linking/test_aiml.py | cotobadesign/cotoba-agent-oss | 104 | 25281 | <gh_stars>100-1000
"""
Copyright (c) 2020 COTOBA DESIGN, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, mer... | 1.8125 | 2 |
activity/activity_ApprovePublication.py | gnott/elife-bot | 0 | 25282 | import base64
import json
import activity
import os
import requests
import boto.sqs
from boto.sqs.message import Message
from provider import eif
"""
ConvertJATS.py activity
"""
parentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
os.sys.path.insert(0, parentdir)
class activity_ApprovePublication(... | 2.125 | 2 |
density_estimation.py | agilevaluechain/100-page-ml | 3 | 25283 | import numpy as np
import scipy as sp
import matplotlib
import matplotlib.pyplot as plt
import math
from sklearn.neighbors import KernelDensity
import scipy.integrate as integrate
from sklearn.kernel_ridge import KernelRidge
matplotlib.rcParams['mathtext.fontset'] = 'stix'
matplotlib.rcParams['font.family'] = 'STIXG... | 2.71875 | 3 |
bot/modules/list.py | styloxyash1/mybot | 0 | 25284 | <reponame>styloxyash1/mybot
from telegram.ext import CommandHandler, run_async
from bot.helper.mirror_utils.upload_utils.gdriveTools import GoogleDriveHelper
from bot import LOGGER, dispatcher
from bot.helper.telegram_helper.message_utils import sendMessage, sendMarkup, editMessage
from bot.helper.telegram_helper.f... | 2.3125 | 2 |
relational/scripts/comments.py | snspam/sn_spam | 0 | 25285 | """
Spam comments to be classified by the relational model.
"""
import os
import numpy as np
class Comments:
def __init__(self, config_obj, util_obj):
self.config_obj = config_obj
self.util_obj = util_obj
# public
def build(self, df, dset, data_f=None, tuffy=False, iden='0'):
"""... | 2.765625 | 3 |
offline_validate.py | akshaykr/oracle_cb | 26 | 25286 | <filename>offline_validate.py
import numpy as np
import sklearn.ensemble
import sklearn.linear_model
import Simulators
import pickle
if __name__=='__main__':
L = 3
B = Simulators.DatasetBandit(dataset='mq2008', L=3, loop=True, metric=None)
Bval = Simulators.DatasetBandit(dataset='mq2008val', L=3, loop=Tru... | 2.4375 | 2 |
yang_et_al/run_tasks.py | wagner-group/geoadex | 4 | 25287 | import os
import logging
import json
from nnattack.variables import auto_var, get_file_name
from params import (
compare_attacks,
compare_defense,
#compare_nns,
nn_k1_robustness,
nn_k3_robustness,
nn_k1_approx_robustness_figs,
dt_robustness_figs,
rf_robustness_figs,
nn_k1_robustn... | 2.109375 | 2 |
asyncio/asyncio02_libs/scrapli/ex01_scrapli_async_basic_factory.py | levs72/pyneng-examples | 11 | 25288 | <reponame>levs72/pyneng-examples<gh_stars>10-100
import asyncio
from scrapli import AsyncScrapli
from scrapli.exceptions import ScrapliException
r1 = {
"host": "192.168.100.1",
"auth_username": "cisco",
"auth_password": "<PASSWORD>",
"auth_secondary": "cisco",
"auth_strict_key": False,
"timeout... | 2.734375 | 3 |
tests/test_nn/test_activations.py | VIVelev/nujo | 5 | 25289 | <filename>tests/test_nn/test_activations.py
import pytest
from numpy import allclose, exp, maximum, sum
import nujo.nn.activations as activ
from nujo.autodiff.tensor import Tensor
# ====================================================================================================
# Test BinaryStep activation functi... | 2.40625 | 2 |
data/data_utils.py | csalt-research/OpenASR-py | 2 | 25290 | import torch
import os
from tqdm import tqdm
import numpy as np
from multiprocessing.pool import Pool
from itertools import islice, cycle
from utils.logging import logger
from utils.misc import ensure_dir
class Vocab(object):
def __init__(self):
self.tok2idx = {}
self.idx2tok = []
self.ad... | 2.265625 | 2 |
config/wsgi.py | poblouin/budgetme-rest-api | 2 | 25291 | <filename>config/wsgi.py<gh_stars>1-10
"""
WSGI config for budgetme project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_applica... | 1.921875 | 2 |
src/compas_ui/objects/networkobject.py | BlockResearchGroup/compas_ui | 0 | 25292 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from functools import reduce
from operator import mul
from compas.geometry import Point
from compas.geometry import Scale
from compas.geometry import Translation
from compas.geometry import Rotation
from compa... | 2.515625 | 3 |
sa/profiles/NAG/SNR/profile.py | xUndero/noc | 1 | 25293 | # -*- coding: utf-8 -*-
# ---------------------------------------------------------------------
# Vendor: NAG
# OS: SNR
# ---------------------------------------------------------------------
# Copyright (C) 2007-2019 The NOC Project
# See LICENSE for details
# ------------------------------------------------------... | 1.953125 | 2 |
src/common/views.py | danpercic86/e-notary | 6 | 25294 | <reponame>danpercic86/e-notary
from django.db.models import QuerySet
from drf_spectacular.utils import extend_schema
from rest_framework import status
from rest_framework.viewsets import ModelViewSet
from common.models import Example
from common.serializers import ExampleSerializer
from common.utils import create_swag... | 1.953125 | 2 |
modpypes/pdu.py | JoelBender/modpypes | 8 | 25295 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Protocol Data Units
===================
"""
import struct
from bacpypes.debugging import bacpypes_debugging, DebugContents, ModuleLogger
from bacpypes.comm import PDUData, PCI
from bacpypes.errors import DecodingError
# some debugging
_debug = 0
_log = ModuleLogger... | 2.46875 | 2 |
rastervision/core/rv_pipeline/object_detection_config.py | jeromemaleski/raster-vision | 0 | 25296 | <reponame>jeromemaleski/raster-vision
from enum import Enum
from rastervision.pipeline.config import register_config, Config, Field
from rastervision.core.rv_pipeline import RVPipelineConfig
from rastervision.core.data.label_store import ObjectDetectionGeoJSONStoreConfig
from rastervision.core.evaluation import Object... | 2.6875 | 3 |
applications/terms_of_service/views.py | awwong1/apollo | 0 | 25297 | <reponame>awwong1/apollo
from apollo.viewmixins import LoginRequiredMixin, StaffRequiredMixin, ActivitySendMixin
from applications.terms_of_service.models import TermsOfService
from django.contrib.messages.views import SuccessMessageMixin
from django.core.urlresolvers import reverse_lazy
from django.views.generic impor... | 2.046875 | 2 |
gateway/helper/event_log.py | ehoefig/stout | 0 | 25298 | import re
import logging
from pydispatch import dispatcher
__author__ = 'edzard'
logger = logging.getLogger(__name__)
_filters = {}
def _handler(sender, **kwargs):
global _filters
for parameter_name in kwargs:
if parameter_name in _filters:
data = kwargs[parameter_name]
if _... | 2.484375 | 2 |
olufekoscrumy/apps.py | olufekosamuel/scrumy | 0 | 25299 | <filename>olufekoscrumy/apps.py
from django.apps import AppConfig
class OlufekoscrumyConfig(AppConfig):
name = 'olufekoscrumy'
| 1.257813 | 1 |