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 |
|---|---|---|---|---|---|---|---|---|---|---|
tests/test_hrepr.py | fabaff/hrepr | 0 | 3200 | from dataclasses import dataclass
from hrepr import H
from hrepr import hrepr as real_hrepr
from hrepr.h import styledir
from .common import one_test_per_assert
css_hrepr = open(f"{styledir}/hrepr.css", encoding="utf-8").read()
hrepr = real_hrepr.variant(fill_resources=False)
@dataclass
class Point:
x: int
... | from dataclasses import dataclass
from hrepr import H
from hrepr import hrepr as real_hrepr
from hrepr.h import styledir
from .common import one_test_per_assert
css_hrepr = open(f"{styledir}/hrepr.css", encoding="utf-8").read()
hrepr = real_hrepr.variant(fill_resources=False)
@dataclass
class Point:
x: int
... | none | 1 | 2.464853 | 2 | |
sympy/assumptions/assume.py | shivangdubey/sympy | 2 | 3201 | <filename>sympy/assumptions/assume.py
import inspect
from sympy.core.cache import cacheit
from sympy.core.singleton import S
from sympy.core.sympify import _sympify
from sympy.logic.boolalg import Boolean
from sympy.utilities.source import get_class
from contextlib import contextmanager
class AssumptionsContext(set):... | <filename>sympy/assumptions/assume.py
import inspect
from sympy.core.cache import cacheit
from sympy.core.singleton import S
from sympy.core.sympify import _sympify
from sympy.logic.boolalg import Boolean
from sympy.utilities.source import get_class
from contextlib import contextmanager
class AssumptionsContext(set):... | en | 0.723836 | Set representing assumptions. This is used to represent global assumptions, but you can also use this class to create your own local assumptions contexts. It is basically a thin wrapper to Python's set, so see its documentation for advanced usage. Examples ======== >>> from sympy import Q ... | 2.651823 | 3 |
distancematrix/tests/consumer/test_distance_matrix.py | IDLabResearch/seriesdistancematrix | 12 | 3202 | import numpy as np
from unittest import TestCase
import numpy.testing as npt
from distancematrix.util import diag_indices_of
from distancematrix.consumer.distance_matrix import DistanceMatrix
class TestContextualMatrixProfile(TestCase):
def setUp(self):
self.dist_matrix = np.array([
[8.67, 1... | import numpy as np
from unittest import TestCase
import numpy.testing as npt
from distancematrix.util import diag_indices_of
from distancematrix.consumer.distance_matrix import DistanceMatrix
class TestContextualMatrixProfile(TestCase):
def setUp(self):
self.dist_matrix = np.array([
[8.67, 1... | none | 1 | 2.420471 | 2 | |
supervisor/const.py | peddamat/home-assistant-supervisor-test | 0 | 3203 | """Constants file for Supervisor."""
from enum import Enum
from ipaddress import ip_network
from pathlib import Path
SUPERVISOR_VERSION = "DEV"
URL_HASSIO_ADDONS = "https://github.com/home-assistant/addons"
URL_HASSIO_APPARMOR = "https://version.home-assistant.io/apparmor.txt"
URL_HASSIO_VERSION = "https://version.ho... | """Constants file for Supervisor."""
from enum import Enum
from ipaddress import ip_network
from pathlib import Path
SUPERVISOR_VERSION = "DEV"
URL_HASSIO_ADDONS = "https://github.com/home-assistant/addons"
URL_HASSIO_APPARMOR = "https://version.home-assistant.io/apparmor.txt"
URL_HASSIO_VERSION = "https://version.ho... | en | 0.855224 | Constants file for Supervisor. # This needs to match the dockerd --cpu-rt-runtime= argument. # The rt runtimes are guarantees, hence we cannot allocate more # time than available! Support up to 5 containers with equal time # allocated. # Note that the time is multiplied by CPU count. This means that # a single containe... | 2.11608 | 2 |
quaesit/agent.py | jgregoriods/quaesit | 0 | 3204 | <gh_stars>0
import inspect
from math import hypot, sin, asin, cos, radians, degrees
from abc import ABCMeta, abstractmethod
from random import randint, choice
from typing import Dict, List, Tuple, Union
class Agent(metaclass=ABCMeta):
"""
Class to represent an agent in an agent-based model.
"""
_id ... | import inspect
from math import hypot, sin, asin, cos, radians, degrees
from abc import ABCMeta, abstractmethod
from random import randint, choice
from typing import Dict, List, Tuple, Union
class Agent(metaclass=ABCMeta):
"""
Class to represent an agent in an agent-based model.
"""
_id = 0
colo... | en | 0.899953 | Class to represent an agent in an agent-based model. Remove the agent from the world. Creates an agent and initializes it with the same parameters as oneself. Places the agent in a different cell of the world grid. Returns the value of a layer in the model's grid for the cell where the agent is. If no l... | 3.382047 | 3 |
models/LRF_COCO_300.py | vaesl/LRF-Net | 180 | 3205 | import torch
import torch.nn as nn
import os
import torch.nn.functional as F
class LDS(nn.Module):
def __init__(self,):
super(LDS, self).__init__()
self.pool1 = nn.MaxPool2d(kernel_size=(2, 2), stride=2, padding=0)
self.pool2 = nn.MaxPool2d(kernel_size=(2, 2), stride=2, padding=0)
... | import torch
import torch.nn as nn
import os
import torch.nn.functional as F
class LDS(nn.Module):
def __init__(self,):
super(LDS, self).__init__()
self.pool1 = nn.MaxPool2d(kernel_size=(2, 2), stride=2, padding=0)
self.pool2 = nn.MaxPool2d(kernel_size=(2, 2), stride=2, padding=0)
... | en | 0.777776 | LRFNet for object detection The network is based on the SSD architecture. Each multibox layer branches into 1) conv2d for class conf scores 2) conv2d for localization predictions 3) associated priorbox layer to produce default bounding boxes specific to the layer's feature map... | 2.58346 | 3 |
tests/test.py | chromia/wandplus | 0 | 3206 | <reponame>chromia/wandplus<gh_stars>0
#!/usr/bin/env python
from wand.image import Image
from wand.drawing import Drawing
from wand.color import Color
import wandplus.image as wpi
from wandplus.textutil import calcSuitableFontsize, calcSuitableImagesize
import os
import unittest
tmpdir = '_tmp/'
def save(img, func... | #!/usr/bin/env python
from wand.image import Image
from wand.drawing import Drawing
from wand.color import Color
import wandplus.image as wpi
from wandplus.textutil import calcSuitableFontsize, calcSuitableImagesize
import os
import unittest
tmpdir = '_tmp/'
def save(img, function, channel=False, ext='.png'):
... | en | 0.621586 | #!/usr/bin/env python # print(path) # not work correctly (IM<6.9.9-36) # TODO: more useful code # NOTE: result is always FAILED. # I don't have an image which has clipping path # NOTE: result is always FAILED. # TODO: input optimized .gif file. <ColorCorrectionCollection xmlns="urn:ASC:CDL:v1.2"> <ColorCorr... | 2.632728 | 3 |
src/librender/tests/test_mesh.py | tizian/layer-laboratory | 7 | 3207 | <gh_stars>1-10
import mitsuba
import pytest
import enoki as ek
from enoki.dynamic import Float32 as Float
from mitsuba.python.test.util import fresolver_append_path
from mitsuba.python.util import traverse
def test01_create_mesh(variant_scalar_rgb):
from mitsuba.core import Struct, float_dtype
from mitsuba.r... | import mitsuba
import pytest
import enoki as ek
from enoki.dynamic import Float32 as Float
from mitsuba.python.test.util import fresolver_append_path
from mitsuba.python.util import traverse
def test01_create_mesh(variant_scalar_rgb):
from mitsuba.core import Struct, float_dtype
from mitsuba.render import Me... | en | 0.596564 | Mesh[ name = "MyMesh", bbox = BoundingBox3f[ min = [0, 0, 0], max = [1, 1, 0] ], vertex_count = 3, vertices = [36 B of vertex data], face_count = 2, faces = [24 B of face data], disable_vertex_normals = 0, surface_area = 0.96 ] <shape type="ply" version="0.5.0"> <string name="filen... | 1.891147 | 2 |
agsadmin/sharing_admin/community/groups/Group.py | christopherblanchfield/agsadmin | 2 | 3208 | from __future__ import (absolute_import, division, print_function, unicode_literals)
from builtins import (ascii, bytes, chr, dict, filter, hex, input, int, map, next, oct, open, pow, range, round, str,
super, zip)
from ...._utils import send_session_request
from ..._PortalEndpointBase import Por... | from __future__ import (absolute_import, division, print_function, unicode_literals)
from builtins import (ascii, bytes, chr, dict, filter, hex, input, int, map, next, oct, open, pow, range, round, str,
super, zip)
from ...._utils import send_session_request
from ..._PortalEndpointBase import Por... | en | 0.604128 | Gets the properties of the item. Updates the group properties. | 2.101469 | 2 |
amy/workshops/migrations/0191_auto_20190809_0936.py | code-review-doctor/amy | 53 | 3209 | <gh_stars>10-100
# Generated by Django 2.1.7 on 2019-08-09 09:36
from django.db import migrations, models
def migrate_public_event(apps, schema_editor):
"""Migrate options previously with no contents (displayed as "Other:")
to a new contents ("other").
The field containing these options is in CommonReque... | # Generated by Django 2.1.7 on 2019-08-09 09:36
from django.db import migrations, models
def migrate_public_event(apps, schema_editor):
"""Migrate options previously with no contents (displayed as "Other:")
to a new contents ("other").
The field containing these options is in CommonRequest abstract model... | en | 0.842992 | # Generated by Django 2.1.7 on 2019-08-09 09:36 Migrate options previously with no contents (displayed as "Other:") to a new contents ("other"). The field containing these options is in CommonRequest abstract model, implemented in WorkshopRequest, WorkshopInquiryRequest, and SelfOrganizedSubmission mode... | 1.799034 | 2 |
pix2pix/Discriminator.py | yubin1219/GAN | 0 | 3210 | <gh_stars>0
import torch
import torch.nn as nn
class Discriminator(nn.Module):
def __init__(self, input_nc, ndf=64, norm_layer=nn.BatchNorm2d, use_sigmoid=False) :
super(Discriminator, self).__init__()
self.conv1 = nn.Sequential(
nn.Conv2d(input_nc, ndf, kernel_size=4, stride=2, padding=1),
nn.Le... | import torch
import torch.nn as nn
class Discriminator(nn.Module):
def __init__(self, input_nc, ndf=64, norm_layer=nn.BatchNorm2d, use_sigmoid=False) :
super(Discriminator, self).__init__()
self.conv1 = nn.Sequential(
nn.Conv2d(input_nc, ndf, kernel_size=4, stride=2, padding=1),
nn.LeakyReLU(0.2,... | none | 1 | 2.607523 | 3 | |
tests/slicebuilders/subpopulations/test_length.py | ANarayan/robustness-gym | 0 | 3211 | from unittest import TestCase
import numpy as np
from robustnessgym.cachedops.spacy import Spacy
from robustnessgym.slicebuilders.subpopulations.length import LengthSubpopulation
from tests.testbeds import MockTestBedv0
class TestLengthSubpopulation(TestCase):
def setUp(self):
self.testbed = MockTestBed... | from unittest import TestCase
import numpy as np
from robustnessgym.cachedops.spacy import Spacy
from robustnessgym.slicebuilders.subpopulations.length import LengthSubpopulation
from tests.testbeds import MockTestBedv0
class TestLengthSubpopulation(TestCase):
def setUp(self):
self.testbed = MockTestBed... | en | 0.749528 | # Create the length subpopulation # Compute scores # Apply the subpopulation # Check that the slice membership lines up | 2.674822 | 3 |
pulsar_spectra/catalogue_papers/Jankowski_2018_raw_to_yaml.py | NickSwainston/pulsar_spectra | 0 | 3212 | import json
from astroquery.vizier import Vizier
with open("Jankowski_2018_raw.txt", "r") as raw_file:
lines = raw_file.readlines()
print(lines)
pulsar_dict = {}
for row in lines[3:]:
row = row.split("|")
print(row)
pulsar = row[0].strip().replace("−", "-")
freqs = []
fluxs = []
flux_e... | import json
from astroquery.vizier import Vizier
with open("Jankowski_2018_raw.txt", "r") as raw_file:
lines = raw_file.readlines()
print(lines)
pulsar_dict = {}
for row in lines[3:]:
row = row.split("|")
print(row)
pulsar = row[0].strip().replace("−", "-")
freqs = []
fluxs = []
flux_e... | en | 0.877641 | # If no error means it's an upper limit andnow sure how to handle it | 2.762995 | 3 |
integration-tests/run-intg-test.py | NishikaDeSilva/identity-test-integration | 4 | 3213 | # Copyright (c) 2018, WSO2 Inc. (http://wso2.com) All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | # Copyright (c) 2018, WSO2 Inc. (http://wso2.com) All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | en | 0.74067 | # Copyright (c) 2018, WSO2 Inc. (http://wso2.com) All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ap... | 1.344899 | 1 |
src/pytest_notification/sound.py | rhpvorderman/pytest-notification | 2 | 3214 | # Copyright (c) 2019 Leiden University Medical Center
#
# 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, me... | # Copyright (c) 2019 Leiden University Medical Center
#
# 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, me... | en | 0.800217 | # Copyright (c) 2019 Leiden University Medical Center # # 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, me... | 1.932613 | 2 |
7KYU/next_prime.py | yaznasivasai/python_codewars | 4 | 3215 | <reponame>yaznasivasai/python_codewars
from math import sqrt
def is_simple(n: int) -> bool:
if n % 2 == 0 and n != 2:
return False
for i in range (3, int(sqrt(n)) + 2, 2):
if n % i == 0 and n != i:
return False
return True
def next_prime(n: int) -> int:
n += 1
if n <= ... | from math import sqrt
def is_simple(n: int) -> bool:
if n % 2 == 0 and n != 2:
return False
for i in range (3, int(sqrt(n)) + 2, 2):
if n % i == 0 and n != i:
return False
return True
def next_prime(n: int) -> int:
n += 1
if n <= 2:
return 2
else:
i... | none | 1 | 4.073567 | 4 | |
cozmo_sdk_examples/if_this_then_that/ifttt_gmail.py | manxueitp/cozmo-test | 0 | 3216 | #!/usr/bin/env python3
# Copyright (c) 2016 Anki, 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 in the file LICENSE.txt or at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unles... | #!/usr/bin/env python3
# Copyright (c) 2016 Anki, 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 in the file LICENSE.txt or at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unles... | en | 0.857152 | #!/usr/bin/env python3 # Copyright (c) 2016 Anki, 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 in the file LICENSE.txt or at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless... | 3.148457 | 3 |
plotutils.py | parkus/mypy | 1 | 3217 | # -*- coding: utf-8 -*-
"""
Created on Fri May 30 17:15:27 2014
@author: Parke
"""
from __future__ import division, print_function, absolute_import
import numpy as np
import matplotlib as mplot
import matplotlib.pyplot as plt
import mypy.my_numpy as mnp
dpi = 100
fullwidth = 10.0
halfwidth = 5.0
# use these with li... | # -*- coding: utf-8 -*-
"""
Created on Fri May 30 17:15:27 2014
@author: Parke
"""
from __future__ import division, print_function, absolute_import
import numpy as np
import matplotlib as mplot
import matplotlib.pyplot as plt
import mypy.my_numpy as mnp
dpi = 100
fullwidth = 10.0
halfwidth = 5.0
# use these with li... | en | 0.806057 | # -*- coding: utf-8 -*- Created on Fri May 30 17:15:27 2014 @author: Parke # use these with line.set_dashes and iterate through more linestyles than come with matplotlib # consider ussing a ::2 slice for fewer # deal with potentially gappy 2-column bin specifications Return x & y scale factors for converting text size... | 2.592157 | 3 |
marvel_world/views.py | xiaoranppp/si664-final | 0 | 3218 | from django.shortcuts import render,redirect
from django.http import HttpResponse,HttpResponseRedirect
from django.views import generic
from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from .models import Character,Comic,Power,CharacterPower,CharacterComic
f... | from django.shortcuts import render,redirect
from django.http import HttpResponse,HttpResponseRedirect
from django.views import generic
from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from .models import Character,Comic,Power,CharacterPower,CharacterComic
f... | en | 0.547229 | # fields = '__all__' <-- superseded by form_class # success_url = reverse_lazy('heritagesites/site_list') # shortcut to object's get_absolute_url() # return HttpResponseRedirect(site.get_absolute_url()) # fields = '__all__' <-- superseded by form_class # success_url = reverse_lazy('heritagesites/site_list') # shortcut ... | 2.157339 | 2 |
src/rpi/fwd.py | au-chrismor/selfdrive | 0 | 3219 | """Set-up and execute the main loop"""
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
#Right motor input A
GPIO.setup(18,GPIO.OUT)
#Right motor input B
GPIO.setup(23,GPIO.OUT)
GPIO.output(18,GPIO.HIGH)
GPIO.output(23,GPIO.LOW)
| """Set-up and execute the main loop"""
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
#Right motor input A
GPIO.setup(18,GPIO.OUT)
#Right motor input B
GPIO.setup(23,GPIO.OUT)
GPIO.output(18,GPIO.HIGH)
GPIO.output(23,GPIO.LOW)
| en | 0.49877 | Set-up and execute the main loop #Right motor input A #Right motor input B | 3.06859 | 3 |
util/get_from_db.py | Abel-Huang/simple-image-classifier | 4 | 3220 | import pymysql
# 连接配置信息
config = {
'host': '127.0.0.1',
'port': 3306,
'user': 'root',
'password': '',
'db': 'classdata',
'charset': 'utf8',
'cursorclass': pymysql.cursors.DictCursor,
}
def get_summary_db(unitag):
# 创建连接
conn = pymysql.connect(**config)
cur = conn.cursor()
... | import pymysql
# 连接配置信息
config = {
'host': '127.0.0.1',
'port': 3306,
'user': 'root',
'password': '',
'db': 'classdata',
'charset': 'utf8',
'cursorclass': pymysql.cursors.DictCursor,
}
def get_summary_db(unitag):
# 创建连接
conn = pymysql.connect(**config)
cur = conn.cursor()
... | zh | 0.923172 | # 连接配置信息 # 创建连接 # 执行sql语句 # 执行sql语句,进行查询 # 获取查询结果 # 创建连接 # 执行sql语句 # 执行sql语句,进行查询 # 获取查询结果 | 2.772267 | 3 |
registerapp/api.py | RajapandiR/django-register | 0 | 3221 | <gh_stars>0
from rest_framework import viewsets
from rest_framework.views import APIView
from registerapp import serializers
from registerapp import models
class RegisterViewSet(viewsets.ModelViewSet):
serializer_class = serializers.RegisterSerializer
queryset = models.RegisterPage.objects.all()
| from rest_framework import viewsets
from rest_framework.views import APIView
from registerapp import serializers
from registerapp import models
class RegisterViewSet(viewsets.ModelViewSet):
serializer_class = serializers.RegisterSerializer
queryset = models.RegisterPage.objects.all() | none | 1 | 1.546759 | 2 | |
jduck/robot.py | luutp/jduck | 0 | 3222 | <reponame>luutp/jduck
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
jduck.py
Description:
Author: luutp
Contact: <EMAIL>
Created on: 2021/02/27
"""
# Utilities
# %%
# ================================IMPORT PACKAGES====================================
# Utilities
from traitlets.config.configurable import Singleto... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
jduck.py
Description:
Author: luutp
Contact: <EMAIL>
Created on: 2021/02/27
"""
# Utilities
# %%
# ================================IMPORT PACKAGES====================================
# Utilities
from traitlets.config.configurable import SingletonConfigurable
# Custo... | en | 0.426247 | #!/usr/bin/env python # -*- coding: utf-8 -*- jduck.py Description: Author: luutp Contact: <EMAIL> Created on: 2021/02/27 # Utilities # %% # ================================IMPORT PACKAGES==================================== # Utilities # Custom Packages # ==============================================================... | 2.482297 | 2 |
src/nebulo/gql/alias.py | olirice/nebulo | 76 | 3223 | # pylint: disable=missing-class-docstring,invalid-name
import typing
from graphql.language import (
InputObjectTypeDefinitionNode,
InputObjectTypeExtensionNode,
ObjectTypeDefinitionNode,
ObjectTypeExtensionNode,
)
from graphql.type import (
GraphQLArgument,
GraphQLBoolean,
GraphQLEnumType,
... | # pylint: disable=missing-class-docstring,invalid-name
import typing
from graphql.language import (
InputObjectTypeDefinitionNode,
InputObjectTypeExtensionNode,
ObjectTypeDefinitionNode,
ObjectTypeExtensionNode,
)
from graphql.type import (
GraphQLArgument,
GraphQLBoolean,
GraphQLEnumType,
... | en | 0.718699 | # pylint: disable=missing-class-docstring,invalid-name # Handle name changes from graphql-core and graphql-core-next # pylint: disable= too-few-public-methods # pylint: disable= too-few-public-methods # pylint: disable= too-few-public-methods | 1.617769 | 2 |
integrations/tensorflow/bindings/python/pyiree/tf/compiler/saved_model_test.py | rise-lang/iree | 1 | 3224 | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | en | 0.894542 | # Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,... | 1.908263 | 2 |
api/models/indicator/child_objects/properties.py | taco-chainalysis/pypulsedive | 0 | 3225 | <reponame>taco-chainalysis/pypulsedive
from .grandchild_objects import Cookies
from .grandchild_objects import Dns
from .grandchild_objects import Dom
from .grandchild_objects import Geo
#from .grandchild_objects import Http
#from .grandchild_objects import Meta
from .grandchild_objects import Ssl
#from .grandchild_obj... | from .grandchild_objects import Cookies
from .grandchild_objects import Dns
from .grandchild_objects import Dom
from .grandchild_objects import Geo
#from .grandchild_objects import Http
#from .grandchild_objects import Meta
from .grandchild_objects import Ssl
#from .grandchild_objects import WhoIs
class Properties(obj... | en | 0.237601 | #from .grandchild_objects import Http #from .grandchild_objects import Meta #from .grandchild_objects import WhoIs #properties.http = Http.from_dictionary(properties.http) #properties.meta = Meta.from_dictionary(properties.meta) #properties.whois = WhoIs.from_dictionary(properties.whois) | 2.257196 | 2 |
iRep/gc_skew.py | scottdaniel/iRep | 55 | 3226 | #!/usr/bin/env python3
"""
script for calculating gc skew
<NAME>
<EMAIL>
"""
# python modules
import os
import sys
import argparse
import numpy as np
from scipy import signal
from itertools import cycle, product
# plotting modules
from matplotlib import use as mplUse
mplUse('Agg')
import matplotlib.pyplot as plt
fr... | #!/usr/bin/env python3
"""
script for calculating gc skew
<NAME>
<EMAIL>
"""
# python modules
import os
import sys
import argparse
import numpy as np
from scipy import signal
from itertools import cycle, product
# plotting modules
from matplotlib import use as mplUse
mplUse('Agg')
import matplotlib.pyplot as plt
fr... | en | 0.804372 | #!/usr/bin/env python3 script for calculating gc skew <NAME> <EMAIL> # python modules # plotting modules # ctb plot with differnt y axes title = title for chart A = data for left axis [[x], [y]] B = data for right axis lables = [left label, right label, x label] legend = [[left legend], [right lege... | 2.489878 | 2 |
examples/send_governance_vote_transaction.py | Algofiorg/algofi-py-sdk | 38 | 3227 | <reponame>Algofiorg/algofi-py-sdk
# This sample is provided for demonstration purposes only.
# It is not intended for production use.
# This example does not constitute trading advice.
import os
from dotenv import dotenv_values
from algosdk import mnemonic, account
from algofi.v1.asset import Asset
from algofi.v1.clien... | # This sample is provided for demonstration purposes only.
# It is not intended for production use.
# This example does not constitute trading advice.
import os
from dotenv import dotenv_values
from algosdk import mnemonic, account
from algofi.v1.asset import Asset
from algofi.v1.client import AlgofiTestnetClient, Algo... | en | 0.823274 | # This sample is provided for demonstration purposes only. # It is not intended for production use. # This example does not constitute trading advice. ### run setup.py before proceeding. make sure the .env file is set with mnemonic + storage_mnemonic. # Hardcoding account keys is not a great practice. This is for demon... | 1.972541 | 2 |
bid/inventoryClient.py | franklx/SOAPpy-py3 | 7 | 3228 | <gh_stars>1-10
#!/usr/bin/env python
import getopt
import sys
import string
import re
import time
sys.path.insert(1,"..")
from SOAPpy import SOAP
import traceback
DEFAULT_SERVERS_FILE = './inventory.servers'
DEFAULT_METHODS = ('SimpleBuy', 'RequestForQuote','Buy','Ping')
def usage (error = None):
sys.s... | #!/usr/bin/env python
import getopt
import sys
import string
import re
import time
sys.path.insert(1,"..")
from SOAPpy import SOAP
import traceback
DEFAULT_SERVERS_FILE = './inventory.servers'
DEFAULT_METHODS = ('SimpleBuy', 'RequestForQuote','Buy','Ping')
def usage (error = None):
sys.stdout = sys.std... | en | 0.63961 | #!/usr/bin/env python usage: %s [options] [server ...] If a long option shows an argument is mandatory, it's mandatory for the equivalent short option also. -?, --help display this usage -d, --debug turn on debugging in the SOAP library -i, --invert test servers *not* in the lis... | 2.744233 | 3 |
src/compile.py | Pixxeasy/WinTools | 0 | 3229 | import os
import json
import shutil
with open("entry.tp") as entry:
entry = json.loads(entry.read())
startcmd = entry['plugin_start_cmd'].split("%TP_PLUGIN_FOLDER%")[1].split("\\")
filedirectory = startcmd[0]
fileName = startcmd[1]
if os.path.exists(filedirectory):
os.remove(os.path.join(os.getcwd(), "Wi... | import os
import json
import shutil
with open("entry.tp") as entry:
entry = json.loads(entry.read())
startcmd = entry['plugin_start_cmd'].split("%TP_PLUGIN_FOLDER%")[1].split("\\")
filedirectory = startcmd[0]
fileName = startcmd[1]
if os.path.exists(filedirectory):
os.remove(os.path.join(os.getcwd(), "Wi... | none | 1 | 2.365768 | 2 | |
suda/1121/12.py | tusikalanse/acm-icpc | 2 | 3230 | <reponame>tusikalanse/acm-icpc
for _ in range(int(input())):
x, y = list(map(int, input().split()))
flag = 1
for i in range(x, y + 1):
n = i * i + i + 41
for j in range(2, n):
if j * j > n:
break
if n % j == 0:
flag = 0
break
if flag == 0:
break
if flag:
print("OK")
else:
print("Sorr... | for _ in range(int(input())):
x, y = list(map(int, input().split()))
flag = 1
for i in range(x, y + 1):
n = i * i + i + 41
for j in range(2, n):
if j * j > n:
break
if n % j == 0:
flag = 0
break
if flag == 0:
break
if flag:
print("OK")
else:
print("Sorry") | none | 1 | 2.937523 | 3 | |
notification/app/node_modules/hiredis/binding.gyp | c2gconsulting/bulkpay | 208 | 3231 | {
'targets': [
{
'target_name': 'hiredis',
'sources': [
'src/hiredis.cc'
, 'src/reader.cc'
],
'include_dirs': ["<!(node -e \"require('nan')\")"],
'dependencies': [
'deps/hiredis.gyp:hiredis-c'
],
'defines': [
'_GNU_SOURCE'
],
... | {
'targets': [
{
'target_name': 'hiredis',
'sources': [
'src/hiredis.cc'
, 'src/reader.cc'
],
'include_dirs': ["<!(node -e \"require('nan')\")"],
'dependencies': [
'deps/hiredis.gyp:hiredis-c'
],
'defines': [
'_GNU_SOURCE'
],
... | none | 1 | 1.006252 | 1 | |
basic_and.py | Verkhovskaya/PyDL | 5 | 3232 | <reponame>Verkhovskaya/PyDL
from pywire import *
def invert(signal):
if signal:
return False
else:
return True
class Inverter:
def __init__(self, a, b):
b.drive(invert, a)
width = 4
a = Signal(width, io="in")
b = Signal(width, io="out")
Inverter(a, b)
build() | from pywire import *
def invert(signal):
if signal:
return False
else:
return True
class Inverter:
def __init__(self, a, b):
b.drive(invert, a)
width = 4
a = Signal(width, io="in")
b = Signal(width, io="out")
Inverter(a, b)
build() | none | 1 | 2.857021 | 3 | |
network/evaluate_keypoints.py | mhsung/deep-functional-dictionaries | 41 | 3233 | # <NAME> (<EMAIL>)
# April 2018
import os, sys
BASE_DIR = os.path.normpath(
os.path.join(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(os.path.join(BASE_DIR, '..'))
from datasets import *
from generate_outputs import *
from scipy.optimize import linear_sum_assignment
#import matplotlib.pyplot a... | # <NAME> (<EMAIL>)
# April 2018
import os, sys
BASE_DIR = os.path.normpath(
os.path.join(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(os.path.join(BASE_DIR, '..'))
from datasets import *
from generate_outputs import *
from scipy.optimize import linear_sum_assignment
#import matplotlib.pyplot a... | en | 0.478744 | # <NAME> (<EMAIL>) # April 2018 #import matplotlib.pyplot as plt # dists_info: (point_cloud_index, label, basis_index, distance) # NOTE: # Skip if the keypoint does not exist. # Find the closest prediction (w/o matching). # Find the best mapping from labels to bases. # NOTE: # Skip if the keypoint does not exist. # dis... | 2.239555 | 2 |
recipes/cxxopts/all/conanfile.py | dvirtz/conan-center-index | 562 | 3234 | import os
from conans import ConanFile, tools
from conans.errors import ConanInvalidConfiguration
class CxxOptsConan(ConanFile):
name = "cxxopts"
homepage = "https://github.com/jarro2783/cxxopts"
url = "https://github.com/conan-io/conan-center-index"
description = "Lightweight C++ option parser librar... | import os
from conans import ConanFile, tools
from conans.errors import ConanInvalidConfiguration
class CxxOptsConan(ConanFile):
name = "cxxopts"
homepage = "https://github.com/jarro2783/cxxopts"
url = "https://github.com/conan-io/conan-center-index"
description = "Lightweight C++ option parser librar... | none | 1 | 2.159584 | 2 | |
p_030_039/problem31.py | ericgreveson/projecteuler | 0 | 3235 | <gh_stars>0
class CoinArray(list):
"""
Coin list that is hashable for storage in sets
The 8 entries are [1p count, 2p count, 5p count, ... , 200p count]
"""
def __hash__(self):
"""
Hash this as a string
"""
return hash(" ".join([str(i) for i in self]))
def main():
... | class CoinArray(list):
"""
Coin list that is hashable for storage in sets
The 8 entries are [1p count, 2p count, 5p count, ... , 200p count]
"""
def __hash__(self):
"""
Hash this as a string
"""
return hash(" ".join([str(i) for i in self]))
def main():
"""
En... | en | 0.87622 | Coin list that is hashable for storage in sets The 8 entries are [1p count, 2p count, 5p count, ... , 200p count] Hash this as a string Entry point # Important: sorted smallest to largest # How many ways are there of making each number from 1 to 200 from these values? # Building up from 1 means we can re-use earlie... | 3.776954 | 4 |
video/cloud-client/quickstart/quickstart.py | nasirdec/GCP-AppEngine-Example | 1 | 3236 | <reponame>nasirdec/GCP-AppEngine-Example
#!/usr/bin/env python
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org... | #!/usr/bin/env python
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | en | 0.813595 | #!/usr/bin/env python # Copyright 2017 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required ... | 2.330203 | 2 |
ally/instrument.py | platformmaster9/PyAlly | 0 | 3237 | from . import utils
#################################################
""" INSTRUMENT """
#################################################
def Instrument(symbol):
symbol = str(symbol).upper()
return {
'__symbol' : symbol,
'Sym' : symbol,
'SecTyp' : 'CS',
... | from . import utils
#################################################
""" INSTRUMENT """
#################################################
def Instrument(symbol):
symbol = str(symbol).upper()
return {
'__symbol' : symbol,
'Sym' : symbol,
'SecTyp' : 'CS',
... | de | 0.802927 | ################################################# INSTRUMENT ################################################# ################################################# ################################################# ################################################# # Let Option do some lifting ##############################... | 2.502283 | 3 |
airbyte-integrations/connectors/source-yahoo-finance-price/integration_tests/acceptance.py | onaio/airbyte | 22 | 3238 | <gh_stars>10-100
#
# Copyright (c) 2022 Airbyte, Inc., all rights reserved.
#
import pytest
pytest_plugins = ("source_acceptance_test.plugin",)
@pytest.fixture(scope="session", autouse=True)
def connector_setup():
"""This fixture is a placeholder for external resources that acceptance test might require."""
... | #
# Copyright (c) 2022 Airbyte, Inc., all rights reserved.
#
import pytest
pytest_plugins = ("source_acceptance_test.plugin",)
@pytest.fixture(scope="session", autouse=True)
def connector_setup():
"""This fixture is a placeholder for external resources that acceptance test might require."""
# TODO: setup t... | en | 0.70285 | # # Copyright (c) 2022 Airbyte, Inc., all rights reserved. # This fixture is a placeholder for external resources that acceptance test might require. # TODO: setup test dependencies if needed. otherwise remove the TODO comments # TODO: clean up test dependencies | 1.655083 | 2 |
ddt/__init__.py | GawenChen/test_pytest | 0 | 3239 | <filename>ddt/__init__.py<gh_stars>0
# -*- coding: utf-8 -*-
"""
@Time : 2021/10/9 17:51
@Auth : 潇湘
@File :__init__.py.py
@IDE :PyCharm
@QQ : 810400085
""" | <filename>ddt/__init__.py<gh_stars>0
# -*- coding: utf-8 -*-
"""
@Time : 2021/10/9 17:51
@Auth : 潇湘
@File :__init__.py.py
@IDE :PyCharm
@QQ : 810400085
""" | ja | 0.469091 | # -*- coding: utf-8 -*- @Time : 2021/10/9 17:51 @Auth : 潇湘 @File :__init__.py.py @IDE :PyCharm @QQ : 810400085 | 1.093307 | 1 |
darts/models/linear_regression_model.py | BiancaMT25/darts | 1 | 3240 | """
Standard Regression model
-------------------------
"""
import numpy as np
import pandas as pd
from typing import Union
from ..logging import get_logger
from .regression_model import RegressionModel
from sklearn.linear_model import LinearRegression
logger = get_logger(__name__)
class LinearRegressionModel(Regre... | """
Standard Regression model
-------------------------
"""
import numpy as np
import pandas as pd
from typing import Union
from ..logging import get_logger
from .regression_model import RegressionModel
from sklearn.linear_model import LinearRegression
logger = get_logger(__name__)
class LinearRegressionModel(Regre... | en | 0.529837 | Standard Regression model ------------------------- Simple wrapper for the linear regression model in scikit-learn, LinearRegression(). Parameters ---------- lags : Union[int, list] Number of lagged target values used to predict the next time step. If an integer is given ... | 3.243891 | 3 |
hail/python/test/hailtop/utils/test_utils.py | vrautela/hail | 0 | 3241 | <reponame>vrautela/hail<gh_stars>0
from hailtop.utils import (partition, url_basename, url_join, url_scheme,
url_and_params, parse_docker_image_reference)
def test_partition_zero_empty():
assert list(partition(0, [])) == []
def test_partition_even_small():
assert list(partition(3,... | from hailtop.utils import (partition, url_basename, url_join, url_scheme,
url_and_params, parse_docker_image_reference)
def test_partition_zero_empty():
assert list(partition(0, [])) == []
def test_partition_even_small():
assert list(partition(3, range(3))) == [range(0, 1), range(... | none | 1 | 2.429473 | 2 | |
hood/urls.py | wadi-1000/Vicinity | 0 | 3242 | <reponame>wadi-1000/Vicinity
from django.urls import path,include
from . import views
urlpatterns = [
path('home/', views.home, name = 'home'),
path('add_hood/',views.uploadNeighbourhood, name = 'add_hood'),
path('viewhood/',views.viewHood, name = 'viewhood'),
path('hood/<int:pk>/',views.hood, name = '... | from django.urls import path,include
from . import views
urlpatterns = [
path('home/', views.home, name = 'home'),
path('add_hood/',views.uploadNeighbourhood, name = 'add_hood'),
path('viewhood/',views.viewHood, name = 'viewhood'),
path('hood/<int:pk>/',views.hood, name = 'hood'),
path('add_bizna/'... | none | 1 | 1.908398 | 2 | |
src/licensedcode/tokenize.py | chetanya-shrimali/scancode-toolkit | 0 | 3243 | <reponame>chetanya-shrimali/scancode-toolkit<filename>src/licensedcode/tokenize.py
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 nexB Inc. and others. All rights reserved.
# http://nexb.com and https://github.com/nexB/scancode-toolkit/
# The ScanCode software is licensed under the Apache License version 2.0.
# Data ge... | # -*- coding: utf-8 -*-
#
# Copyright (c) 2017 nexB Inc. and others. All rights reserved.
# http://nexb.com and https://github.com/nexB/scancode-toolkit/
# The ScanCode software is licensed under the Apache License version 2.0.
# Data generated with ScanCode require an acknowledgment.
# ScanCode is a trademark of nexB ... | en | 0.816271 | # -*- coding: utf-8 -*- # # Copyright (c) 2017 nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/scancode-toolkit/ # The ScanCode software is licensed under the Apache License version 2.0. # Data generated with ScanCode require an acknowledgment. # ScanCode is a trademark of nexB ... | 1.523827 | 2 |
etest_test/fixtures_test/ebuilds_test/__init__.py | alunduil/etest | 6 | 3244 | <filename>etest_test/fixtures_test/ebuilds_test/__init__.py
"""Ebuild Test Fixtures."""
import os
from typing import Any, Dict, List
from etest_test import helpers_test
EBUILDS: Dict[str, List[Dict[str, Any]]] = {}
helpers_test.import_directory(__name__, os.path.dirname(__file__))
| <filename>etest_test/fixtures_test/ebuilds_test/__init__.py
"""Ebuild Test Fixtures."""
import os
from typing import Any, Dict, List
from etest_test import helpers_test
EBUILDS: Dict[str, List[Dict[str, Any]]] = {}
helpers_test.import_directory(__name__, os.path.dirname(__file__))
| en | 0.471038 | Ebuild Test Fixtures. | 1.742343 | 2 |
src/model.py | palucki/RememberIt | 0 | 3245 | import random
from pymongo import MongoClient
from observable import Observable
from phrase import Phrase
class MongoDbProxy:
"""Proxy for MongoDB"""
def __init__(self, url, dbName, tableName):
self.client = MongoClient(url)
self.db = self.client[dbName]
self.table = tableName
... | import random
from pymongo import MongoClient
from observable import Observable
from phrase import Phrase
class MongoDbProxy:
"""Proxy for MongoDB"""
def __init__(self, url, dbName, tableName):
self.client = MongoClient(url)
self.db = self.client[dbName]
self.table = tableName
... | en | 0.769959 | Proxy for MongoDB #[{ "english": eng, "polish" : pl}] #define your data struct here #lang = phrase["lang"] That needs a table of pairs - eng and its meanings #That's for future optimization: update db instead of adding it all #Handle also value update | 2.785247 | 3 |
sampleApplication/clientGenerator.py | chall68/BlackWatch | 0 | 3246 | #!flask/bin/python
#from user import User
from sampleObjects.User import User
from datetime import datetime
from sampleObjects.DetectionPoint import DetectionPoint
import time, requests, random, atexit
def requestGenerator():
userObject = randomUser()
detectionPointObject = randomDetectionPoint()
req = r... | #!flask/bin/python
#from user import User
from sampleObjects.User import User
from datetime import datetime
from sampleObjects.DetectionPoint import DetectionPoint
import time, requests, random, atexit
def requestGenerator():
userObject = randomUser()
detectionPointObject = randomDetectionPoint()
req = r... | en | 0.47917 | #!flask/bin/python #from user import User | 2.696324 | 3 |
news_collector/collector/consumers.py | ridwaniyas/channels-examples | 0 | 3247 | <gh_stars>0
import asyncio
import json
import datetime
from aiohttp import ClientSession
from channels.generic.http import AsyncHttpConsumer
from .constants import BLOGS
class NewsCollectorAsyncConsumer(AsyncHttpConsumer):
"""
Async HTTP consumer that fetches URLs.
"""
async def handle(self, body):
... | import asyncio
import json
import datetime
from aiohttp import ClientSession
from channels.generic.http import AsyncHttpConsumer
from .constants import BLOGS
class NewsCollectorAsyncConsumer(AsyncHttpConsumer):
"""
Async HTTP consumer that fetches URLs.
"""
async def handle(self, body):
# Ad... | en | 0.764413 | Async HTTP consumer that fetches URLs. # Adapted from: # "Making 1 million requests with python-aiohttp" # https://pawelmhm.github.io/asyncio/python/aiohttp/2016/04/22/asyncio-aiohttp.html # aiohttp allows a ClientSession object to link all requests together # Launch a coroutine for each URL fetch # Wait on, and then g... | 3.303971 | 3 |
src/randomcsv/FileUtils.py | PhilipBuhr/randomCsv | 0 | 3248 | import os
from pathlib import Path
def write(file_name, content):
Path(os.path.dirname(file_name)).mkdir(parents=True, exist_ok=True)
with open(file_name, 'w') as file:
file.write(content)
def read_line_looping(file_name, count):
i = 0
lines = []
file = open(file_name, 'r')
line = fi... | import os
from pathlib import Path
def write(file_name, content):
Path(os.path.dirname(file_name)).mkdir(parents=True, exist_ok=True)
with open(file_name, 'w') as file:
file.write(content)
def read_line_looping(file_name, count):
i = 0
lines = []
file = open(file_name, 'r')
line = fi... | none | 1 | 3.537999 | 4 | |
stringtoiso/__init__.py | vats98754/stringtoiso | 0 | 3249 | from stringtoiso.convert_to_iso import convert | from stringtoiso.convert_to_iso import convert | none | 1 | 1.159444 | 1 | |
aux_sys_err_prediction_module/additive/R_runmed_spline/my_R_runmed_spline_analysis.py | PNNL-Comp-Mass-Spec/DtaRefinery | 0 | 3250 | from aux_sys_err_prediction_module.additive.R_runmed_spline.my_R_runmed_spline_fit import R_runmed_smooth_spline
from numpy import random, array, median, zeros, arange, hstack
from win32com.client import Dispatch
import math
myName = 'R_runmed_spline'
useMAD = True # use median absolute deviations instead of ... | from aux_sys_err_prediction_module.additive.R_runmed_spline.my_R_runmed_spline_fit import R_runmed_smooth_spline
from numpy import random, array, median, zeros, arange, hstack
from win32com.client import Dispatch
import math
myName = 'R_runmed_spline'
useMAD = True # use median absolute deviations instead of ... | en | 0.320557 | # use median absolute deviations instead of sum of squared residues # ----------------------------------------------------------------------- # ARG3 # get the best smoothing parameter # get the prediction error for this smoothing parameter # compare with original SSE # is fit successful? # return isSuccessfulFit, yFit,... | 2.352252 | 2 |
setup.py | Ms2ger/python-zstandard | 0 | 3251 | #!/usr/bin/env python
# Copyright (c) 2016-present, <NAME>
# All rights reserved.
#
# This software may be modified and distributed under the terms
# of the BSD license. See the LICENSE file for details.
import os
import sys
from setuptools import setup
try:
import cffi
except ImportError:
cffi = None
import... | #!/usr/bin/env python
# Copyright (c) 2016-present, <NAME>
# All rights reserved.
#
# This software may be modified and distributed under the terms
# of the BSD license. See the LICENSE file for details.
import os
import sys
from setuptools import setup
try:
import cffi
except ImportError:
cffi = None
import... | en | 0.78388 | #!/usr/bin/env python # Copyright (c) 2016-present, <NAME> # All rights reserved. # # This software may be modified and distributed under the terms # of the BSD license. See the LICENSE file for details. # Code for obtaining the Extension instance is in its own module to # facilitate reuse in other projects. # Need cha... | 1.693883 | 2 |
Escolas/Curso em Video/Back-End/Curso de Python/Mundos/Mundo 01/Exercicio_16.py | c4st1lh0/Projetos-de-Aula | 0 | 3252 | <gh_stars>0
import math
num = float(input('Digite um numero real qualquer: '))
print('O numero: {} tem a parte inteira {}'.format(num, math.trunc(num))) | import math
num = float(input('Digite um numero real qualquer: '))
print('O numero: {} tem a parte inteira {}'.format(num, math.trunc(num))) | none | 1 | 3.923307 | 4 | |
mmdet/ops/orn/functions/__init__.py | JarvisUSTC/DARDet | 274 | 3253 | <filename>mmdet/ops/orn/functions/__init__.py
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import torch
from .active_rotating_filter import active_rotating_filter
from .active_rotating_filter import ActiveRotatingFilter
from .rotation_invariant_encoding import rotation_invariant_encoding
from... | <filename>mmdet/ops/orn/functions/__init__.py
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import torch
from .active_rotating_filter import active_rotating_filter
from .active_rotating_filter import ActiveRotatingFilter
from .rotation_invariant_encoding import rotation_invariant_encoding
from... | en | 0.935519 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. | 1.288559 | 1 |
sympy/core/tests/test_cache.py | eriknw/sympy | 7 | 3254 | <reponame>eriknw/sympy
from sympy.core.cache import cacheit
def test_cacheit_doc():
@cacheit
def testfn():
"test docstring"
pass
assert testfn.__doc__ == "test docstring"
assert testfn.__name__ == "testfn"
| from sympy.core.cache import cacheit
def test_cacheit_doc():
@cacheit
def testfn():
"test docstring"
pass
assert testfn.__doc__ == "test docstring"
assert testfn.__name__ == "testfn" | none | 1 | 2.091979 | 2 | |
mmdet/models/losses/ranking_losses.py | VietDunghacker/VarifocalNet | 0 | 3255 | <gh_stars>0
import torch
class RankSort(torch.autograd.Function):
@staticmethod
def forward(ctx, logits, targets, delta_RS=0.50, eps=1e-10):
classification_grads=torch.zeros(logits.shape).cuda()
#Filter fg logits
fg_labels = (targets > 0.)
fg_logits = logits[fg_labels]
fg_targets = targets[fg_labels]
... | import torch
class RankSort(torch.autograd.Function):
@staticmethod
def forward(ctx, logits, targets, delta_RS=0.50, eps=1e-10):
classification_grads=torch.zeros(logits.shape).cuda()
#Filter fg logits
fg_labels = (targets > 0.)
fg_logits = logits[fg_labels]
fg_targets = targets[fg_labels]
fg_num = l... | en | 0.811857 | #Filter fg logits #Do not use bg with scores less than minimum fg logit #since changing its score does not have an effect on precision #sort the fg logits #Loops over each positive following the order # Difference Transforms (x_ij) # Rank of ii among pos and false positive number (bg with larger scores) # Rank of ii am... | 2.337481 | 2 |
tests/test_dcd_api.py | sadamek/pyIMX | 0 | 3256 | # Copyright (c) 2017-2018 <NAME>
#
# SPDX-License-Identifier: BSD-3-Clause
# The BSD-3-Clause license for this file can be found in the LICENSE file included with this distribution
# or at https://spdx.org/licenses/BSD-3-Clause.html#licenseText
import os
import pytest
from imx import img
# Used Directories
DATA_DIR =... | # Copyright (c) 2017-2018 <NAME>
#
# SPDX-License-Identifier: BSD-3-Clause
# The BSD-3-Clause license for this file can be found in the LICENSE file included with this distribution
# or at https://spdx.org/licenses/BSD-3-Clause.html#licenseText
import os
import pytest
from imx import img
# Used Directories
DATA_DIR =... | en | 0.779057 | # Copyright (c) 2017-2018 <NAME> # # SPDX-License-Identifier: BSD-3-Clause # The BSD-3-Clause license for this file can be found in the LICENSE file included with this distribution # or at https://spdx.org/licenses/BSD-3-Clause.html#licenseText # Used Directories # Test Files # Prepare test environment # Clean test env... | 2.058728 | 2 |
recentjson.py | nydailynews/feedutils | 0 | 3257 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Return recent items from a json feed. Recent means "In the last X days."
import os
import doctest
import json
import urllib2
import argparse
import types
import gzip
from datetime import datetime, timedelta
from time import mktime
class RecentJson:
""" Methods for in... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Return recent items from a json feed. Recent means "In the last X days."
import os
import doctest
import json
import urllib2
import argparse
import types
import gzip
from datetime import datetime, timedelta
from time import mktime
class RecentJson:
""" Methods for in... | en | 0.510483 | #!/usr/bin/env python # -*- coding: utf-8 -*- # Return recent items from a json feed. Recent means "In the last X days." Methods for ingesting and publishing JSON feeds. >>> url = 'http://www.nydailynews.com/json/cmlink/aaron-judge-1.3306628' >>> parser = build_parser() >>> args = parser.parse_a... | 3.475658 | 3 |
maint/MultiStage2.py | Liastre/pcre2 | 0 | 3258 | <gh_stars>0
#! /usr/bin/python
# Multistage table builder
# (c) <NAME>, 2008
##############################################################################
# This script was submitted to the PCRE project by <NAME>owski as part of
# the upgrading of Unicode property support. The new code speeds up property
# matching ... | #! /usr/bin/python
# Multistage table builder
# (c) <NAME>, 2008
##############################################################################
# This script was submitted to the PCRE project by <NAME>owski as part of
# the upgrading of Unicode property support. The new code speeds up property
# matching many times. ... | en | 0.85744 | #! /usr/bin/python # Multistage table builder # (c) <NAME>, 2008 ############################################################################## # This script was submitted to the PCRE project by <NAME>owski as part of # the upgrading of Unicode property support. The new code speeds up property # matching many times. Th... | 1.818842 | 2 |
setup.py | ihayhurst/RetroBioCat | 9 | 3259 | from setuptools import setup, find_packages
from retrobiocat_web import __version__
with open('requirements.txt') as f:
requirements = f.read().splitlines()
setup(
name = 'retrobiocat_web',
packages = find_packages(),
include_package_data=True,
version = __version__,
license='',
description = 'Retrosynt... | from setuptools import setup, find_packages
from retrobiocat_web import __version__
with open('requirements.txt') as f:
requirements = f.read().splitlines()
setup(
name = 'retrobiocat_web',
packages = find_packages(),
include_package_data=True,
version = __version__,
license='',
description = 'Retrosynt... | none | 1 | 1.368532 | 1 | |
rxn_yield_context/preprocess_data/preprocess/augmentation_utils.py | Lung-Yi/rxn_yield_context | 0 | 3260 | # -*- coding: utf-8 -*-
import pickle
import numpy as np
from rdkit import Chem
from rdkit.Chem import AllChem,DataStructs
def get_classes(path):
f = open(path, 'rb')
dict_ = pickle.load(f)
f.close()
classes = sorted(dict_.items(), key=lambda d: d[1],reverse=True)
classes = [(x,y) fo... | # -*- coding: utf-8 -*-
import pickle
import numpy as np
from rdkit import Chem
from rdkit.Chem import AllChem,DataStructs
def get_classes(path):
f = open(path, 'rb')
dict_ = pickle.load(f)
f.close()
classes = sorted(dict_.items(), key=lambda d: d[1],reverse=True)
classes = [(x,y) fo... | en | 0.874122 | # -*- coding: utf-8 -*- # Similar as the above function but takes smiles separately and returns pfp and rfp separately | 2.430828 | 2 |
src/webstruct-demo/__init__.py | zanachka/webstruct-demo | 5 | 3261 | import functools
import logging
import random
from flask import Flask, render_template, request
import joblib
from lxml.html import html5parser
import lxml.html
import requests
import yarl
import webstruct.model
import webstruct.sequence_encoding
import webstruct.webannotator
webstruct_demo = Flask(__name__, instan... | import functools
import logging
import random
from flask import Flask, render_template, request
import joblib
from lxml.html import html5parser
import lxml.html
import requests
import yarl
import webstruct.model
import webstruct.sequence_encoding
import webstruct.webannotator
webstruct_demo = Flask(__name__, instan... | none | 1 | 2.188601 | 2 | |
setup.py | Liang813/einops | 4,738 | 3262 | <gh_stars>1000+
__author__ = '<NAME>'
from setuptools import setup
setup(
name="einops",
version='0.3.2',
description="A new flavour of deep learning operations",
long_description=open('README.md', encoding='utf-8').read(),
long_description_content_type='text/markdown',
url='https://github.com... | __author__ = '<NAME>'
from setuptools import setup
setup(
name="einops",
version='0.3.2',
description="A new flavour of deep learning operations",
long_description=open('README.md', encoding='utf-8').read(),
long_description_content_type='text/markdown',
url='https://github.com/arogozhnikov/ei... | en | 0.639078 | # no run-time or installation-time dependencies | 1.450342 | 1 |
website/migrations/0084_auto_20210215_1401.py | czhu1217/cmimc-online | 0 | 3263 | # Generated by Django 3.1.6 on 2021-02-15 19:01
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('website', '0083_remove_aisubmission_code'),
]
operations = [
migrations.AddField(
model_name='e... | # Generated by Django 3.1.6 on 2021-02-15 19:01
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('website', '0083_remove_aisubmission_code'),
]
operations = [
migrations.AddField(
model_name='e... | en | 0.738003 | # Generated by Django 3.1.6 on 2021-02-15 19:01 | 1.66378 | 2 |
ldp/tasks/dlp.py | evandez/low-dimensional-probing | 1 | 3264 | """Core experiments for the dependency label prediction task."""
import collections
import copy
import logging
from typing import (Any, Dict, Iterator, Optional, Sequence, Set, Tuple, Type,
Union)
from ldp import datasets, learning
from ldp.models import probes, projections
from ldp.parse import pt... | """Core experiments for the dependency label prediction task."""
import collections
import copy
import logging
from typing import (Any, Dict, Iterator, Optional, Sequence, Set, Tuple, Type,
Union)
from ldp import datasets, learning
from ldp.models import probes, projections
from ldp.parse import pt... | en | 0.793221 | Core experiments for the dependency label prediction task. Map pairs of words to their syntactic relationship, if any. Map each relation label to an integer. Args: samples (Sequence[ptb.Sample]): The samples from which to determine possible relations. unk (str): Label to... | 2.49103 | 2 |
pycquery_krb/common/ccache.py | naver/PyCQuery | 2 | 3265 | <filename>pycquery_krb/common/ccache.py
#!/usr/bin/env python3
#
# Author:
# <NAME> (@skelsec)
#
import os
import io
import datetime
import glob
import hashlib
from pycquery_krb.protocol.asn1_structs import Ticket, EncryptedData, \
krb5_pvno, KrbCredInfo, EncryptionKey, KRBCRED, TicketFlags, EncKrbCredPart
from pyc... | <filename>pycquery_krb/common/ccache.py
#!/usr/bin/env python3
#
# Author:
# <NAME> (@skelsec)
#
import os
import io
import datetime
import glob
import hashlib
from pycquery_krb.protocol.asn1_structs import Ticket, EncryptedData, \
krb5_pvno, KrbCredInfo, EncryptionKey, KRBCRED, TicketFlags, EncKrbCredPart
from pyc... | en | 0.753576 | #!/usr/bin/env python3 # # Author: # <NAME> (@skelsec) # # http://repo.or.cz/w/krb5dissect.git/blob_plain/HEAD:/ccache.txt returns a list of header tags Returns the native format of an AS_REP message and the sessionkey in EncryptionKey native format Returns the native format of an AS_REP message and the sessionkey in ... | 2.404756 | 2 |
getUniformSmiles.py | OpenEye-Contrib/Molecular-List-Logic | 2 | 3266 | #!/opt/az/psf/python/2.7/bin/python
from openeye.oechem import *
import cgi
#creates a list of smiles of the syntax [smiles|molId,smiles|molId]
def process_smiles(smiles):
smiles = smiles.split('\n')
mol = OEGraphMol()
smiles_list=[]
for line in smiles:
if len(line.rstrip())>0:
lin... | #!/opt/az/psf/python/2.7/bin/python
from openeye.oechem import *
import cgi
#creates a list of smiles of the syntax [smiles|molId,smiles|molId]
def process_smiles(smiles):
smiles = smiles.split('\n')
mol = OEGraphMol()
smiles_list=[]
for line in smiles:
if len(line.rstrip())>0:
lin... | en | 0.639596 | #!/opt/az/psf/python/2.7/bin/python #creates a list of smiles of the syntax [smiles|molId,smiles|molId] #can't send spaces or new lines #takes a list of smiles and writes it as sdf using a memory buffer #creates a list of smiles of the syntax [smiles|molId,smiles|molId] #if only one file is supplied #removes all double... | 2.656068 | 3 |
mfem/_par/gridfunc.py | mfem/PyMFEM | 93 | 3267 | <filename>mfem/_par/gridfunc.py
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 4.0.2
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info as _swig_python_version_info
if _swig_python_version_inf... | <filename>mfem/_par/gridfunc.py
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 4.0.2
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info as _swig_python_version_info
if _swig_python_version_inf... | en | 0.371163 | # This file was automatically generated by SWIG (http://www.swig.org). # Version 4.0.2 # # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead. # Import the low-level C/C++ module Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down ve... | 2.149814 | 2 |
src/tracks/settings.py | adcarmichael/tracks | 0 | 3268 | import os
import sentry_sdk
from sentry_sdk.integrations.django import DjangoIntegration
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
PWA_SERVICE_WORKER_PATH = os.path.join(
BASE_DIR, 'routes/static/routes/js', 'serv... | import os
import sentry_sdk
from sentry_sdk.integrations.django import DjangoIntegration
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
PWA_SERVICE_WORKER_PATH = os.path.join(
BASE_DIR, 'routes/static/routes/js', 'serv... | en | 0.493959 | # Build paths inside the project like this: os.path.join(BASE_DIR, ...) # 'DJANGO_ALLOWED_HOSTS' should be a single string of hosts with a space between each. # For example: 'DJANGO_ALLOWED_HOSTS=localhost 127.0.0.1 [::1]' # Application definition # 'celery', # Database # https://docs.djangoproject.com/en/2.2/ref/setti... | 2.064196 | 2 |
examples/04-lights/plotter_builtins.py | akeshavan/pyvista | 0 | 3269 | <reponame>akeshavan/pyvista
"""
Plotter Lighting Systems
~~~~~~~~~~~~~~~~~~~~~~~~
The :class:`pyvista.Plotter` class comes with three options for the default
lighting system:
* a light kit consisting of a headlight and four camera lights,
* an illumination system containing three lights arranged around the camera... | """
Plotter Lighting Systems
~~~~~~~~~~~~~~~~~~~~~~~~
The :class:`pyvista.Plotter` class comes with three options for the default
lighting system:
* a light kit consisting of a headlight and four camera lights,
* an illumination system containing three lights arranged around the camera,
* no lighting.
With mes... | en | 0.718818 | Plotter Lighting Systems ~~~~~~~~~~~~~~~~~~~~~~~~ The :class:`pyvista.Plotter` class comes with three options for the default lighting system: * a light kit consisting of a headlight and four camera lights, * an illumination system containing three lights arranged around the camera, * no lighting. With meshes ... | 2.924774 | 3 |
src/swimport/tests/15_char_arrays/main.py | talos-gis/swimport | 1 | 3270 | <reponame>talos-gis/swimport<gh_stars>1-10
from swimport.all import *
src = FileSource('src.h')
swim = Swim('example')
swim(pools.c_string)
swim(pools.numpy_arrays(r"../resources", allow_char_arrays=True))
swim(pools.include(src))
assert swim(Function.Behaviour()(src)) > 0
swim.write('example.i')
print('ok!') | from swimport.all import *
src = FileSource('src.h')
swim = Swim('example')
swim(pools.c_string)
swim(pools.numpy_arrays(r"../resources", allow_char_arrays=True))
swim(pools.include(src))
assert swim(Function.Behaviour()(src)) > 0
swim.write('example.i')
print('ok!') | none | 1 | 1.995222 | 2 | |
ipyvolume/astro.py | larsoner/ipyvolume | 1 | 3271 | <gh_stars>1-10
import numpy as np
import PIL.Image
import pythreejs
import ipyvolume as ipv
from .datasets import UrlCached
def _randomSO3():
"""return random rotatation matrix, algo by <NAME>"""
u1 = np.random.random()
u2 = np.random.random()
u3 = np.random.random()
R = np.array([[np.cos(2*np.pi... | import numpy as np
import PIL.Image
import pythreejs
import ipyvolume as ipv
from .datasets import UrlCached
def _randomSO3():
"""return random rotatation matrix, algo by <NAME>"""
u1 = np.random.random()
u2 = np.random.random()
u3 = np.random.random()
R = np.array([[np.cos(2*np.pi*u1), np.sin(2*... | en | 0.772271 | return random rotatation matrix, algo by <NAME> Create a fake galaxy around the points orbit_x/y/z with N_stars around it # + #print(x.shape, xo.shape) | 2.871742 | 3 |
deepfunning/function.py | Zrealshadow/DeepFunning | 0 | 3272 | '''
* @author Waldinsamkeit
* @email <EMAIL>
* @create date 2020-09-25 14:33:38
* @desc
'''
import torch
'''--------------------- Weighted Binary cross Entropy ----------------------'''
'''
In Torch BCELoss, weight is set to every element of input instead of to every class
'''
def weighted_binary_cross_entropy... | '''
* @author Waldinsamkeit
* @email <EMAIL>
* @create date 2020-09-25 14:33:38
* @desc
'''
import torch
'''--------------------- Weighted Binary cross Entropy ----------------------'''
'''
In Torch BCELoss, weight is set to every element of input instead of to every class
'''
def weighted_binary_cross_entropy... | en | 0.576595 | * @author Waldinsamkeit * @email <EMAIL> * @create date 2020-09-25 14:33:38 * @desc --------------------- Weighted Binary cross Entropy ---------------------- In Torch BCELoss, weight is set to every element of input instead of to every class ---------------------- Binary focal loss function ------------------------... | 2.709236 | 3 |
dlms_cosem/hdlc/address.py | pwitab/dlms-cosem | 35 | 3273 | from typing import *
import attr
from dlms_cosem.hdlc import validators
@attr.s(auto_attribs=True)
class HdlcAddress:
"""
A client address shall always be expressed on one byte.
To enable addressing more than one logical device within a single physical device
and to support the multi-drop configurat... | from typing import *
import attr
from dlms_cosem.hdlc import validators
@attr.s(auto_attribs=True)
class HdlcAddress:
"""
A client address shall always be expressed on one byte.
To enable addressing more than one logical device within a single physical device
and to support the multi-drop configurat... | en | 0.896083 | A client address shall always be expressed on one byte. To enable addressing more than one logical device within a single physical device and to support the multi-drop configuration the server address may be divided in two parts– may be divided into two parts: The logical address to address a logical de... | 3.155602 | 3 |
benchmarks/benchmarks/stats.py | RasmusSemmle/scipy | 1 | 3274 | from __future__ import division, absolute_import, print_function
import warnings
import numpy as np
try:
import scipy.stats as stats
except ImportError:
pass
from .common import Benchmark
class Anderson_KSamp(Benchmark):
def setup(self, *args):
self.rand = [np.random.normal(loc=i, size=1000) fo... | from __future__ import division, absolute_import, print_function
import warnings
import numpy as np
try:
import scipy.stats as stats
except ImportError:
pass
from .common import Benchmark
class Anderson_KSamp(Benchmark):
def setup(self, *args):
self.rand = [np.random.normal(loc=i, size=1000) fo... | en | 0.820046 | # test different sized sample with variances # test different sized sample with different variances # Retain old benchmark results (remove this if changing the benchmark) | 2.209831 | 2 |
src/production_ecommerce/account/models.py | sheriffbarrow/production-ecommerce | 1 | 3275 | <gh_stars>1-10
from django.db import models
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager
class MyAccountManager(BaseUserManager):
def create_user(self, email, username, password=None):
if not email:
raise ValueError('Users must have an email address')
if not username:
raise Valu... | from django.db import models
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager
class MyAccountManager(BaseUserManager):
def create_user(self, email, username, password=None):
if not email:
raise ValueError('Users must have an email address')
if not username:
raise ValueError('Users m... | en | 0.922052 | # notice the absence of a "Password field", that is built in. # Email & Password are required by default. # For checking permissions. to keep it simple all admin have ALL permissons # Does this user have permission to view this app? (ALWAYS YES FOR SIMPLICITY) # notice the absence of a "Password field", that is built i... | 2.617987 | 3 |
dbtmetabase/models/config.py | fernandobrito/dbt-metabase | 0 | 3276 | from dataclasses import dataclass, field
from typing import Optional, Iterable, Union
@dataclass
class MetabaseConfig:
# Metabase Client
database: str
host: str
user: str
password: str
# Metabase additional connection opts
use_http: bool = False
verify: Union[str, bool] = True
# Me... | from dataclasses import dataclass, field
from typing import Optional, Iterable, Union
@dataclass
class MetabaseConfig:
# Metabase Client
database: str
host: str
user: str
password: str
# Metabase additional connection opts
use_http: bool = False
verify: Union[str, bool] = True
# Me... | en | 0.688354 | # Metabase Client # Metabase additional connection opts # Metabase Sync # dbt Reader # dbt Target Models | 2.215387 | 2 |
src/plot_timeseries_outstanding_bytes.py | arunksaha/heap_tracker | 1 | 3277 | <reponame>arunksaha/heap_tracker<filename>src/plot_timeseries_outstanding_bytes.py<gh_stars>1-10
#
# Copyright 2018, <NAME> <<EMAIL>>
#
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.dates as md
import datetime as dt
import sys
import os
# Open the file, read the string contents into a list,
# and... | #
# Copyright 2018, <NAME> <<EMAIL>>
#
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.dates as md
import datetime as dt
import sys
import os
# Open the file, read the string contents into a list,
# and return the list.
def GetLinesListFromFile(filename):
with open(filename) as f:
content = f... | en | 0.641917 | # # Copyright 2018, <NAME> <<EMAIL>> # # Open the file, read the string contents into a list, # and return the list. # Convert usecs (numeric) to datetime # >>> ts = 1520189090755278 / 1000000.0 # >>> x = datetime.datetime.fromtimestamp(ts) # >>> x.strftime('%Y-%m-%d %H:%M:%S.%f') # '2018-03-04 10:44:50.755278' # Attem... | 3.048948 | 3 |
import.py | vmariano/meme-classifier | 0 | 3278 | from dotenv import load_dotenv
load_dotenv()
import sys
import os
import re
import json
import psycopg2
from meme_classifier.images import process_image
path = sys.argv[1]
data = json.load(open(os.path.join(path, 'result.json'), 'r'))
chat_id = data['id']
conn = psycopg2.connect(os.getenv('POSTGRES_CREDENTIALS'))
... | from dotenv import load_dotenv
load_dotenv()
import sys
import os
import re
import json
import psycopg2
from meme_classifier.images import process_image
path = sys.argv[1]
data = json.load(open(os.path.join(path, 'result.json'), 'r'))
chat_id = data['id']
conn = psycopg2.connect(os.getenv('POSTGRES_CREDENTIALS'))
... | none | 1 | 2.383147 | 2 | |
nps/migrations/0013_auto_20180314_1805.py | jak0203/nps-dash | 0 | 3279 | # Generated by Django 2.0.3 on 2018-03-15 01:05
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('nps', '0012_auto_20180314_1600'),
]
operations = [
migrations.CreateModel(
name='ClientAggregations',
fields=[
... | # Generated by Django 2.0.3 on 2018-03-15 01:05
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('nps', '0012_auto_20180314_1600'),
]
operations = [
migrations.CreateModel(
name='ClientAggregations',
fields=[
... | en | 0.744498 | # Generated by Django 2.0.3 on 2018-03-15 01:05 | 1.67871 | 2 |
docs/schema_mapping.py | NoAnyLove/pydantic | 1 | 3280 | <reponame>NoAnyLove/pydantic
#!/usr/bin/env python3
"""
Build a table of Python / Pydantic to JSON Schema mappings.
Done like this rather than as a raw rst table to make future edits easier.
Please edit this file directly not .tmp_schema_mappings.rst
"""
table = [
[
'bool',
'boolean',
'',... | #!/usr/bin/env python3
"""
Build a table of Python / Pydantic to JSON Schema mappings.
Done like this rather than as a raw rst table to make future edits easier.
Please edit this file directly not .tmp_schema_mappings.rst
"""
table = [
[
'bool',
'boolean',
'',
'JSON Schema Core',
... | en | 0.691851 | #!/usr/bin/env python3 Build a table of Python / Pydantic to JSON Schema mappings. Done like this rather than as a raw rst table to make future edits easier. Please edit this file directly not .tmp_schema_mappings.rst | 2.381485 | 2 |
hubspot3/test/test_broadcast.py | kevin2357/hubspot3 | 1 | 3281 | import time
import unittest
from nose.plugins.attrib import attr
from hubspot3.test import helper
from hubspot3.broadcast import Broadcast, BroadcastClient
class BroadcastClientTest(unittest.TestCase):
""" Unit tests for the HubSpot Broadcast API Python client.
This file contains some unittest tests for the ... | import time
import unittest
from nose.plugins.attrib import attr
from hubspot3.test import helper
from hubspot3.broadcast import Broadcast, BroadcastClient
class BroadcastClientTest(unittest.TestCase):
""" Unit tests for the HubSpot Broadcast API Python client.
This file contains some unittest tests for the ... | en | 0.856629 | Unit tests for the HubSpot Broadcast API Python client. This file contains some unittest tests for the Broadcast API. Questions, comments: http://docs.hubapi.com/wiki/Discussion_Group # Cancel any broadcasts created as part of the tests # Should fetch at least 1 broadcast on the test portal 62515 # Re-fetch t... | 2.679896 | 3 |
benchmark/benchmarks/testdata.py | theroggy/geofile_ops | 0 | 3282 | <filename>benchmark/benchmarks/testdata.py
# -*- coding: utf-8 -*-
"""
Module to prepare test data for benchmarking geo operations.
"""
import enum
import logging
from pathlib import Path
import pprint
import shutil
import sys
import tempfile
from typing import Optional
import urllib.request
import zipfile
# Add path... | <filename>benchmark/benchmarks/testdata.py
# -*- coding: utf-8 -*-
"""
Module to prepare test data for benchmarking geo operations.
"""
import enum
import logging
from pathlib import Path
import pprint
import shutil
import sys
import tempfile
from typing import Optional
import urllib.request
import zipfile
# Add path... | en | 0.507639 | # -*- coding: utf-8 -*- Module to prepare test data for benchmarking geo operations. # Add path so the benchmark packages are found ################################################################################ # Some inits ################################################################################ #############... | 2.345085 | 2 |
relocation/depth/setup_relocation_dir.py | ziyixi/SeisScripts | 0 | 3283 | <reponame>ziyixi/SeisScripts
"""
setup earthquake depth relocation directory
"""
import obspy
import sh
import numpy as np
import click
from os.path import join
from glob import glob
import copy
def generate_new_cmtsolution_files(cmts_dir, generated_cmts_dir, depth_perturbation_list):
cmt_names = glob(join(cmts_... | """
setup earthquake depth relocation directory
"""
import obspy
import sh
import numpy as np
import click
from os.path import join
from glob import glob
import copy
def generate_new_cmtsolution_files(cmts_dir, generated_cmts_dir, depth_perturbation_list):
cmt_names = glob(join(cmts_dir, "*"))
for cmt_file i... | en | 0.748484 | setup earthquake depth relocation directory # gcmt_id = event.resource_id.id.split("/")[-2] # there are some problems in changing names # assume dirs like f"{generated_cmts_dir}/d-3" have already been created # there are always problem in copy event, so here I'd like to read in the event again # event_this_depth = even... | 2.453579 | 2 |
python-client/trustedanalytics/core/atktypes.py | blbarker/atk | 1 | 3284 | <reponame>blbarker/atk
# vim: set encoding=utf-8
#
# Copyright (c) 2015 Intel Corporation
#
# 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/LICENS... | # vim: set encoding=utf-8
#
# Copyright (c) 2015 Intel Corporation
#
# 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 requi... | en | 0.449109 | # vim: set encoding=utf-8 # # Copyright (c) 2015 Intel Corporation # # 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 require... | 2.417522 | 2 |
srd/pageaggregator.py | poikilos/tabletopManualMiner | 0 | 3285 | #!/usr/bin/env python3
import math
try:
# from PDFPageDetailedAggregator:
from pdfminer.pdfdocument import PDFDocument, PDFNoOutlines
from pdfminer.pdfparser import PDFParser
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter
from pdfminer.converter import PDFPageAggregator
... | #!/usr/bin/env python3
import math
try:
# from PDFPageDetailedAggregator:
from pdfminer.pdfdocument import PDFDocument, PDFNoOutlines
from pdfminer.pdfparser import PDFParser
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter
from pdfminer.converter import PDFPageAggregator
... | en | 0.517412 | #!/usr/bin/env python3 # from PDFPageDetailedAggregator: # Python 3 # TODO: class DocFragment: def __init__(self, text, fontname, size): self.text = text self.fontname = fontname self.size = size def sameStyle(self, fragment): """ Is same fontname and size. """ ... | 2.433158 | 2 |
ctrltest.py | dkim286/cpsc454-proj | 0 | 3286 | from pox.core import core
import pox.openflow.libopenflow_01 as of
from forwarding.l2_learning import *
from tkinter import *
from project.firewall import TestFW
from project.ui import UI
def setup():
top = Toplevel()
# quit POX when window is killed
top.protocol("WM_DELETE_WINDOW", core.quit)
t... | from pox.core import core
import pox.openflow.libopenflow_01 as of
from forwarding.l2_learning import *
from tkinter import *
from project.firewall import TestFW
from project.ui import UI
def setup():
top = Toplevel()
# quit POX when window is killed
top.protocol("WM_DELETE_WINDOW", core.quit)
t... | en | 0.797368 | # quit POX when window is killed # register firewall # just use L2 learning switch for others #core.registerNew(UI) | 2.5051 | 3 |
virtual/lib/python3.6/site-packages/mako/__init__.py | kenmutuma001/Blog | 1 | 3287 | # mako/__init__.py
# Copyright (C) 2006-2016 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
__version__ = '1.0.9'
| # mako/__init__.py
# Copyright (C) 2006-2016 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
__version__ = '1.0.9'
| en | 0.687714 | # mako/__init__.py # Copyright (C) 2006-2016 the Mako authors and contributors <see AUTHORS file> # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php | 0.933798 | 1 |
image_classification/T2T_ViT/load_pytorch_weights.py | RangeKing/PaddleViT | 0 | 3288 | <reponame>RangeKing/PaddleViT<filename>image_classification/T2T_ViT/load_pytorch_weights.py
# Copyright (c) 2021 PPViT Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the Licen... | # Copyright (c) 2021 PPViT Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | en | 0.773097 | # Copyright (c) 2021 PPViT Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l... | 2.392464 | 2 |
estimators/__init__.py | j-bac/id-concentration | 0 | 3289 | <reponame>j-bac/id-concentration
from ._FisherS import randsphere, preprocessing, SeparabilityAnalysis, point_inseparability_to_pointID
from ._call_estimators import TwoNN, run_singleGMST,run_singleCorrDim,runDANCo, runDANCoStats, runDANColoop,runANOVAglobal,runANOVAlocal,radovanovic_estimators_matlab,Hidalgo
from ._DA... | from ._FisherS import randsphere, preprocessing, SeparabilityAnalysis, point_inseparability_to_pointID
from ._call_estimators import TwoNN, run_singleGMST,run_singleCorrDim,runDANCo, runDANCoStats, runDANColoop,runANOVAglobal,runANOVAlocal,radovanovic_estimators_matlab,Hidalgo
from ._DANCo import dancoDimEst as danco_p... | none | 1 | 0.987704 | 1 | |
examples/get_message.py | NeroAsmarr/fz-api | 71 | 3290 | # 获取调课、改课通知例子
from zfnew import GetInfo, Login
base_url = '学校教务系统的主页url'
lgn = Login(base_url=base_url)
lgn.login('账号', '密码')
cookies = lgn.cookies # cookies获取方法
person = GetInfo(base_url=base_url, cookies=cookies)
message = person.get_message()
print(message)
| # 获取调课、改课通知例子
from zfnew import GetInfo, Login
base_url = '学校教务系统的主页url'
lgn = Login(base_url=base_url)
lgn.login('账号', '密码')
cookies = lgn.cookies # cookies获取方法
person = GetInfo(base_url=base_url, cookies=cookies)
message = person.get_message()
print(message)
| ja | 0.831159 | # 获取调课、改课通知例子 # cookies获取方法 | 2.509433 | 3 |
input/gera_entradas.py | AtilioA/Sort-merge-join | 0 | 3291 | import sys
import random
from faker import Faker
def gera(nLinhas=100, nCampos=None):
with open(f"{path}/file{nLinhas}-{nCampos}_python.txt", "w+", encoding="utf8") as file:
if not nCampos:
nCampos = random.randint(2, 10)
camposFuncs = [
fake.name,
fake.date,
... | import sys
import random
from faker import Faker
def gera(nLinhas=100, nCampos=None):
with open(f"{path}/file{nLinhas}-{nCampos}_python.txt", "w+", encoding="utf8") as file:
if not nCampos:
nCampos = random.randint(2, 10)
camposFuncs = [
fake.name,
fake.date,
... | none | 1 | 2.867282 | 3 | |
lessons 20/HomeWork/task9.py | zainllw0w/skillbox | 0 | 3292 | <reponame>zainllw0w/skillbox
def sort(data, time):
tt = False
ft = True
st = False
is_find = True
winers_name = set()
index = 0
while is_find:
index += 1
for key, values in data.items():
if time[0 - index] == int(values[1]) and ft and values[0] not in winers_name:... | def sort(data, time):
tt = False
ft = True
st = False
is_find = True
winers_name = set()
index = 0
while is_find:
index += 1
for key, values in data.items():
if time[0 - index] == int(values[1]) and ft and values[0] not in winers_name:
first_id = k... | none | 1 | 3.767819 | 4 | |
src/test-apps/happy/test-templates/WeaveInetDNS.py | aiw-google/openweave-core | 1 | 3293 | #!/usr/bin/env python
#
# Copyright (c) 2016-2017 Nest Labs, Inc.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/lice... | #!/usr/bin/env python
#
# Copyright (c) 2016-2017 Nest Labs, Inc.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/lice... | en | 0.761605 | #!/usr/bin/env python # # Copyright (c) 2016-2017 Nest Labs, Inc. # All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licens... | 2.122936 | 2 |
funcoes.py | ZezaoDev/Circtrigo | 0 | 3294 | <reponame>ZezaoDev/Circtrigo
import turtle as t
import math
class circTrigo:
def __init__(self):
self.raio = 0
self.grau = 0
self.seno = 0
self.cosseno = 0
self.tangente = 0
self.quadrante = 0
self.tema = ''
t.bgcolor("black")
t.pencolor("wh... | import turtle as t
import math
class circTrigo:
def __init__(self):
self.raio = 0
self.grau = 0
self.seno = 0
self.cosseno = 0
self.tangente = 0
self.quadrante = 0
self.tema = ''
t.bgcolor("black")
t.pencolor("white")
def seta(s... | pt | 0.399054 | # DESENHA UMA SETA # DESENHA UMA LINHA PONTILHADA # RETORNA PRA POSICAO INICIAL # DESENHA O CIRCULO # EIXO X # EIXO Y # DESENHA O ANGULO # DEFINE O VALOR DO SENO, COSSENO E TANGENTE. # DEFINE O QUADRANTE DO ANGULO # Quadrante 0 representa os angulos de resultados indefinidos # DESENHA O SENO # DESENHA O COSSENO # DESEN... | 3.743772 | 4 |
examples/catapi/feeder.py | IniZio/py-skygear | 8 | 3295 | <gh_stars>1-10
def pick_food(name):
if name == "chima":
return "chicken"
else:
return "dry food"
| def pick_food(name):
if name == "chima":
return "chicken"
else:
return "dry food" | none | 1 | 3.546209 | 4 | |
esm/model.py | crochereau/esm | 1 | 3296 | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from .modules import (
TransformerLayer,
LearnedPosit... | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from .modules import (
TransformerLayer,
LearnedPosit... | en | 0.862235 | # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # B, T # x: B x T x C # (B, T, E) => (T, B, E) # (H, B, T, T) => (B, H, T, T) # (T, B, E) => (B, T, E) # last hidden representation should have... | 1.841103 | 2 |
python/tink/aead/kms_envelope_aead.py | bfloch/tink | 0 | 3297 | <reponame>bfloch/tink
# Copyright 2020 Google LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | # Copyright 2020 Google LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | en | 0.835995 | # Copyright 2020 Google LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,... | 2.604687 | 3 |
tests/pyb/can.py | LabAixBidouille/micropython | 0 | 3298 | from pyb import CAN
CAN.initfilterbanks(14)
can = CAN(1)
print(can)
can.init(CAN.LOOPBACK)
print(can)
print(can.any(0))
# Catch all filter
can.setfilter(0, CAN.MASK16, 0, (0, 0, 0, 0))
can.send('abcd', 123)
print(can.any(0))
print(can.recv(0))
can.send('abcd', -1)
print(can.recv(0))
can.send('abcd', 0x7FF + 1)
pr... | from pyb import CAN
CAN.initfilterbanks(14)
can = CAN(1)
print(can)
can.init(CAN.LOOPBACK)
print(can)
print(can.any(0))
# Catch all filter
can.setfilter(0, CAN.MASK16, 0, (0, 0, 0, 0))
can.send('abcd', 123)
print(can.any(0))
print(can.recv(0))
can.send('abcd', -1)
print(can.recv(0))
can.send('abcd', 0x7FF + 1)
pr... | en | 0.574065 | # Catch all filter # Test too long message # Testing extended IDs # Catch all filter # Test RxCallbacks | 2.283997 | 2 |
quarkchain/cluster/tests/test_miner.py | TahiG/pyquarkchain | 17 | 3299 | <filename>quarkchain/cluster/tests/test_miner.py
import asyncio
import time
import unittest
from typing import Optional
from quarkchain.cluster.miner import DoubleSHA256, Miner, MiningWork, validate_seal
from quarkchain.config import ConsensusType
from quarkchain.core import RootBlock, RootBlockHeader
from quarkchain.... | <filename>quarkchain/cluster/tests/test_miner.py
import asyncio
import time
import unittest
from typing import Optional
from quarkchain.cluster.miner import DoubleSHA256, Miner, MiningWork, validate_seal
from quarkchain.config import ConsensusType
from quarkchain.core import RootBlock, RootBlockHeader
from quarkchain.... | en | 0.92113 | # guarantee target time is hit # stop the game # should generate 5 blocks and then end # only 2 blocks can be added # only process one block, which is passed in. `None` means termination right after # only process one block, which is passed in. `None` means termination right after # no current work, will generate a new... | 2.345788 | 2 |