hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f747580f6197f3f7bbc084f2de11a067326d1d2a | 1,347 | py | Python | esphome/components/rgbw/light.py | OttoWinter/esphomeyaml | 6a85259e4d6d1b0a0f819688b8e555efcb99ecb0 | [
"MIT"
] | 249 | 2018-04-07T12:04:11.000Z | 2019-01-25T01:11:34.000Z | esphome/components/rgbw/light.py | OttoWinter/esphomeyaml | 6a85259e4d6d1b0a0f819688b8e555efcb99ecb0 | [
"MIT"
] | 243 | 2018-04-11T16:37:11.000Z | 2019-01-25T16:50:37.000Z | esphome/components/rgbw/light.py | OttoWinter/esphomeyaml | 6a85259e4d6d1b0a0f819688b8e555efcb99ecb0 | [
"MIT"
] | 40 | 2018-04-10T05:50:14.000Z | 2019-01-25T15:20:36.000Z | import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import light, output
from esphome.const import (
CONF_BLUE,
CONF_COLOR_INTERLOCK,
CONF_GREEN,
CONF_RED,
CONF_OUTPUT_ID,
CONF_WHITE,
)
rgbw_ns = cg.esphome_ns.namespace("rgbw")
RGBWLightOutput = rgbw_ns.c... | 32.853659 | 70 | 0.729027 | import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import light, output
from esphome.const import (
CONF_BLUE,
CONF_COLOR_INTERLOCK,
CONF_GREEN,
CONF_RED,
CONF_OUTPUT_ID,
CONF_WHITE,
)
rgbw_ns = cg.esphome_ns.namespace("rgbw")
RGBWLightOutput = rgbw_ns.c... | true | true |
f74758d8338130b4d2860ed97fbeb43ef74d6be7 | 22,203 | py | Python | core/controllers/feedback_test.py | gauravzqa/oppia | 52a859f251eeb8729834551bfda9f577b06f29e9 | [
"Apache-2.0"
] | 1 | 2019-01-31T18:48:50.000Z | 2019-01-31T18:48:50.000Z | core/controllers/feedback_test.py | debck/oppia | 7126b42bf105724cb82dd2d4df377e7a35c3ca18 | [
"Apache-2.0"
] | null | null | null | core/controllers/feedback_test.py | debck/oppia | 7126b42bf105724cb82dd2d4df377e7a35c3ca18 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... | 40.005405 | 80 | 0.634374 |
from core.domain import exp_domain
from core.domain import exp_services
from core.domain import feedback_services
from core.domain import rights_manager
from core.domain import state_domain
from core.domain import suggestion_services
from core.domain import user_services
from core.platform import model... | true | true |
f74759c51c2068ae977ddbd17243e3f921ef0bfb | 2,484 | py | Python | ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/prefix_14ff2c47c83ae14aa22718e67f21f827.py | rfrye-github/ixnetwork_restpy | 23eeb24b21568a23d3f31bbd72814ff55eb1af44 | [
"MIT"
] | null | null | null | ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/prefix_14ff2c47c83ae14aa22718e67f21f827.py | rfrye-github/ixnetwork_restpy | 23eeb24b21568a23d3f31bbd72814ff55eb1af44 | [
"MIT"
] | null | null | null | ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/prefix_14ff2c47c83ae14aa22718e67f21f827.py | rfrye-github/ixnetwork_restpy | 23eeb24b21568a23d3f31bbd72814ff55eb1af44 | [
"MIT"
] | null | null | null | # MIT LICENSE
#
# Copyright 1997 - 2020 by IXIA Keysight
#
# 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, ... | 38.8125 | 138 | 0.688003 |
from ixnetwork_restpy.base import Base
from ixnetwork_restpy.files import Files
class Prefix(Base):
__slots__ = ()
_SDM_NAME = 'prefix'
_SDM_ATT_MAP = {
'Prefix': 'prefix',
}
def __init__(self, parent):
super(Prefix, self).__init__(parent)
... | true | true |
f7475ae2c548bcc5bf7fd66c8400e9baf449d6c9 | 1,508 | py | Python | src/proposals/admin.py | jneo8/pycon.tw | 2c8eb9d8f06febe678292b1bd77ae0bfca005098 | [
"MIT"
] | 1 | 2019-04-04T12:17:26.000Z | 2019-04-04T12:17:26.000Z | src/proposals/admin.py | jneo8/pycon.tw | 2c8eb9d8f06febe678292b1bd77ae0bfca005098 | [
"MIT"
] | null | null | null | src/proposals/admin.py | jneo8/pycon.tw | 2c8eb9d8f06febe678292b1bd77ae0bfca005098 | [
"MIT"
] | 2 | 2019-04-04T12:18:04.000Z | 2019-04-14T13:57:57.000Z | from django.contrib import admin
from django.contrib.contenttypes.admin import GenericTabularInline
from import_export.admin import ExportMixin
from .models import AdditionalSpeaker, TalkProposal, TutorialProposal
from .resources import TalkProposalResource
class AdditionalSpeakerInline(GenericTabularInline):
m... | 31.416667 | 69 | 0.699602 | from django.contrib import admin
from django.contrib.contenttypes.admin import GenericTabularInline
from import_export.admin import ExportMixin
from .models import AdditionalSpeaker, TalkProposal, TutorialProposal
from .resources import TalkProposalResource
class AdditionalSpeakerInline(GenericTabularInline):
m... | true | true |
f7475cfda9d36b72a1bc06e51333dc2cc89d1535 | 12,735 | py | Python | cw/__init__.py | ankkks/CardWirthPy-Lite | cfa9f4315b8adcf01a3ebb40237f2e8ee5f02f45 | [
"bzip2-1.0.6"
] | null | null | null | cw/__init__.py | ankkks/CardWirthPy-Lite | cfa9f4315b8adcf01a3ebb40237f2e8ee5f02f45 | [
"bzip2-1.0.6"
] | null | null | null | cw/__init__.py | ankkks/CardWirthPy-Lite | cfa9f4315b8adcf01a3ebb40237f2e8ee5f02f45 | [
"bzip2-1.0.6"
] | 1 | 2022-03-16T07:49:27.000Z | 2022-03-16T07:49:27.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import traceback
import wx
import pygame
import util
import battle
import yadodb
import data
import dice
import effectmotion
import event
import eventhandler
import eventrelay
import features
import scenariodb
import setting
imp... | 29.009112 | 110 | 0.600314 |
import os
import sys
import traceback
import wx
import pygame
import util
import battle
import yadodb
import data
import dice
import effectmotion
import event
import eventhandler
import eventrelay
import features
import scenariodb
import setting
import skin
import animation
import thread
imp... | true | true |
f7475dd268e2c73fb725ba14450f11075d606a80 | 914 | py | Python | oneruns/testSetCreation.py | CSC522-Data-mining-NCSU/jf_alg2 | cfd31806325c3d19b1bdc467070e7d56e9ff52c3 | [
"MIT"
] | null | null | null | oneruns/testSetCreation.py | CSC522-Data-mining-NCSU/jf_alg2 | cfd31806325c3d19b1bdc467070e7d56e9ff52c3 | [
"MIT"
] | null | null | null | oneruns/testSetCreation.py | CSC522-Data-mining-NCSU/jf_alg2 | cfd31806325c3d19b1bdc467070e7d56e9ff52c3 | [
"MIT"
] | null | null | null | import csv,pdb
import mysql.connector
import random
Movie2test = []
for i in range(100):
m = random.randint(1,14000)
if m not in Movie2test: Movie2test.append(m)
Movie2test = sorted(Movie2test)
"""
connecting the database...
"""
cnx = mysql.connector.connect(user='root', password = '54321', host = '127.0.0.1'... | 21.255814 | 104 | 0.624726 | import csv,pdb
import mysql.connector
import random
Movie2test = []
for i in range(100):
m = random.randint(1,14000)
if m not in Movie2test: Movie2test.append(m)
Movie2test = sorted(Movie2test)
cnx = mysql.connector.connect(user='root', password = '54321', host = '127.0.0.1', database = 'Netflix')
cursor = cn... | true | true |
f7475eb378882f460e6bafbe12258d05e6159221 | 3,037 | py | Python | archive_test.py | lcombs15/WikiArchive | 3096af08159ace55d70b9be35ee3c1d561e7d1a2 | [
"MIT"
] | null | null | null | archive_test.py | lcombs15/WikiArchive | 3096af08159ace55d70b9be35ee3c1d561e7d1a2 | [
"MIT"
] | null | null | null | archive_test.py | lcombs15/WikiArchive | 3096af08159ace55d70b9be35ee3c1d561e7d1a2 | [
"MIT"
] | null | null | null | import unittest
from datetime import datetime
import archive
class TestArchive(unittest.TestCase):
"""
Various unit tests for wiki.web.archive
Lucas Combs
April 2019
"""
def test_remove_file_extension(self):
"""
Verify that the file extension is removed.
... | 33.01087 | 117 | 0.608824 | import unittest
from datetime import datetime
import archive
class TestArchive(unittest.TestCase):
def test_remove_file_extension(self):
file = "readme.md"
self.assertEqual("readme", archive.remove_file_extension(file))
def test_get_file_extension(self):
file = "notes.txt"
s... | true | true |
f7475f692e7389074b03194337f1098216fc6abc | 10,592 | py | Python | pyyoutube/models/video.py | w3Abhishek/python-youtube | e5830e035c41aa8164ca6932e3be7f05b0bec63c | [
"MIT"
] | 156 | 2019-09-01T13:57:49.000Z | 2022-03-31T13:51:21.000Z | pyyoutube/models/video.py | w3Abhishek/python-youtube | e5830e035c41aa8164ca6932e3be7f05b0bec63c | [
"MIT"
] | 88 | 2019-10-20T16:08:50.000Z | 2022-02-08T10:50:54.000Z | pyyoutube/models/video.py | niwla23/python-youtube-async | f4acb4cbced3b3bd25b8e3f0f095da57525a79d9 | [
"MIT"
] | 33 | 2019-10-15T17:46:38.000Z | 2022-01-30T04:50:49.000Z | """
These are video related models.
"""
from dataclasses import dataclass, field
from typing import Optional, List
import isodate
from isodate import ISO8601Error
from pyyoutube.error import ErrorCode, ErrorMessage, PyYouTubeException
from .base import BaseModel
from .common import (
BaseApiResponse,
Base... | 42.709677 | 112 | 0.719505 | from dataclasses import dataclass, field
from typing import Optional, List
import isodate
from isodate import ISO8601Error
from pyyoutube.error import ErrorCode, ErrorMessage, PyYouTubeException
from .base import BaseModel
from .common import (
BaseApiResponse,
BaseTopicDetails,
BaseResource,
Localize... | true | true |
f74760075253d5375f3f5902cdbb59941fc80449 | 29,720 | py | Python | openmdao/solvers/test/test_ln_direct.py | naylor-b/OpenMDAO1 | 49d82f6601b33db9bdcf7d146d030d55e3b62ef4 | [
"Apache-2.0"
] | 17 | 2018-01-11T20:13:59.000Z | 2022-03-22T03:46:05.000Z | openmdao/solvers/test/test_ln_direct.py | naylor-b/OpenMDAO1 | 49d82f6601b33db9bdcf7d146d030d55e3b62ef4 | [
"Apache-2.0"
] | 6 | 2017-10-19T23:14:14.000Z | 2020-11-22T17:30:57.000Z | openmdao/solvers/test/test_ln_direct.py | naylor-b/OpenMDAO1 | 49d82f6601b33db9bdcf7d146d030d55e3b62ef4 | [
"Apache-2.0"
] | 10 | 2018-04-12T22:13:33.000Z | 2020-05-07T10:02:59.000Z | """ Unit test for the DirectSolver linear solver. """
import unittest
import numpy as np
from openmdao.api import Group, Problem, IndepVarComp, ExecComp, DirectSolver, \
LinearGaussSeidel, Newton
from openmdao.core.test.test_residual_sign import SimpleImplicitSL
from openmdao.test.converge_di... | 38.249678 | 90 | 0.576245 |
import unittest
import numpy as np
from openmdao.api import Group, Problem, IndepVarComp, ExecComp, DirectSolver, \
LinearGaussSeidel, Newton
from openmdao.core.test.test_residual_sign import SimpleImplicitSL
from openmdao.test.converge_diverge import ConvergeDiverge, SingleDiamond, \
... | true | true |
f7476037b81b0cbe4c30fd11ab91f9d6a5148e0b | 3,471 | py | Python | data-processing/common/commands/detect_entities.py | rishamsidhu/scholar-reader | fa97cd5fb57305ff96ac060e225d1c331da31654 | [
"Apache-2.0"
] | null | null | null | data-processing/common/commands/detect_entities.py | rishamsidhu/scholar-reader | fa97cd5fb57305ff96ac060e225d1c331da31654 | [
"Apache-2.0"
] | null | null | null | data-processing/common/commands/detect_entities.py | rishamsidhu/scholar-reader | fa97cd5fb57305ff96ac060e225d1c331da31654 | [
"Apache-2.0"
] | 1 | 2020-10-23T12:36:11.000Z | 2020-10-23T12:36:11.000Z | import os.path
from abc import ABC, abstractmethod
from dataclasses import dataclass
from typing import Iterator, Type
from common import directories, file_utils
from common.commands.base import ArxivBatchCommand
from common.parse_tex import EntityExtractor
from common.types import ArxivId, FileContents, RelativePath,... | 36.15625 | 98 | 0.680207 | import os.path
from abc import ABC, abstractmethod
from dataclasses import dataclass
from typing import Iterator, Type
from common import directories, file_utils
from common.commands.base import ArxivBatchCommand
from common.parse_tex import EntityExtractor
from common.types import ArxivId, FileContents, RelativePath,... | true | true |
f74760934633233eb7d56b71d556000e3b6c44f2 | 18,119 | py | Python | utils/dataset.py | ad6398/Pointer-Generator-NW | 4bf997453fb8570fe04668318ca3861cb7d23ecf | [
"MIT"
] | null | null | null | utils/dataset.py | ad6398/Pointer-Generator-NW | 4bf997453fb8570fe04668318ca3861cb7d23ecf | [
"MIT"
] | null | null | null | utils/dataset.py | ad6398/Pointer-Generator-NW | 4bf997453fb8570fe04668318ca3861cb7d23ecf | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import csv
import glob
import time
import queue
import struct
import numpy as np
import tensorflow as tf
from random import shuffle
from threading import Thread
from tensorflow.core.example import example_pb2
from utils import utils
from utils import config
import random
random.seed(1234)
#... | 47.933862 | 133 | 0.621006 |
import csv
import glob
import time
import queue
import struct
import numpy as np
import tensorflow as tf
from random import shuffle
from threading import Thread
from tensorflow.core.example import example_pb2
from utils import utils
from utils import config
import random
random.seed(1234)
SENTENCE_STA = '<s>'
SE... | true | true |
f7476285d7b4b83aa9c5cdc17c515647752b01b1 | 10,370 | py | Python | opta/core/aws.py | wpride/opta | 04b745019af595464f4a8060b9bffa2399c137e0 | [
"Apache-2.0"
] | null | null | null | opta/core/aws.py | wpride/opta | 04b745019af595464f4a8060b9bffa2399c137e0 | [
"Apache-2.0"
] | null | null | null | opta/core/aws.py | wpride/opta | 04b745019af595464f4a8060b9bffa2399c137e0 | [
"Apache-2.0"
] | null | null | null | import json
from time import sleep
from typing import TYPE_CHECKING, List, Optional, TypedDict
import boto3
from botocore.config import Config
from mypy_boto3_dynamodb import DynamoDBClient
from opta.utils import fmt_msg, logger
if TYPE_CHECKING:
from opta.layer import Layer, StructuredConfig
class AwsArn(Type... | 35.392491 | 98 | 0.585632 | import json
from time import sleep
from typing import TYPE_CHECKING, List, Optional, TypedDict
import boto3
from botocore.config import Config
from mypy_boto3_dynamodb import DynamoDBClient
from opta.utils import fmt_msg, logger
if TYPE_CHECKING:
from opta.layer import Layer, StructuredConfig
class AwsArn(Type... | true | true |
f74763949c6952e8e479913681e5c30a711f900c | 806 | py | Python | tasks/migrations/0005_auto_20191231_1702.py | madhu0309/Django-Crm | a07b250372d996a29bd567cf7aa365cf66fb9c05 | [
"MIT"
] | null | null | null | tasks/migrations/0005_auto_20191231_1702.py | madhu0309/Django-Crm | a07b250372d996a29bd567cf7aa365cf66fb9c05 | [
"MIT"
] | null | null | null | tasks/migrations/0005_auto_20191231_1702.py | madhu0309/Django-Crm | a07b250372d996a29bd567cf7aa365cf66fb9c05 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.4 on 2019-12-31 11:32
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('tasks', '0004_task_teams... | 29.851852 | 163 | 0.653846 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('tasks', '0004_task_teams'),
]
operations = [
migration... | true | true |
f74763d27dc505854c6287253f292b315ac0cd1f | 349 | py | Python | practice/check.py | veterinarian-5300/Genious-Python-Code-Generator | d78cd5f4b64221e8e4dc80d6e1f5ba0a4c613bcd | [
"Apache-2.0"
] | 1 | 2021-09-27T06:24:21.000Z | 2021-09-27T06:24:21.000Z | practice/check.py | veterinarian-5300/Genious-Python-Code-Generator | d78cd5f4b64221e8e4dc80d6e1f5ba0a4c613bcd | [
"Apache-2.0"
] | null | null | null | practice/check.py | veterinarian-5300/Genious-Python-Code-Generator | d78cd5f4b64221e8e4dc80d6e1f5ba0a4c613bcd | [
"Apache-2.0"
] | null | null | null | import csv
import pandas as pd
one=pd.read_csv("pa_dashboards.csv")
two=pd.read_csv("pa_dashboards(1).csv", squeeze=True)
pattern = '|'.join(two)
exist=one['sentences'].str.contains(pattern, na=False)
with open('new.csv', 'w') as outFile:
for cols in exist:
if pattern in exist:
... | 21.8125 | 55 | 0.638968 | import csv
import pandas as pd
one=pd.read_csv("pa_dashboards.csv")
two=pd.read_csv("pa_dashboards(1).csv", squeeze=True)
pattern = '|'.join(two)
exist=one['sentences'].str.contains(pattern, na=False)
with open('new.csv', 'w') as outFile:
for cols in exist:
if pattern in exist:
... | true | true |
f74763fc24a56e7ff3e01edc54fcd401e84bdc96 | 2,147 | py | Python | emis_account/conf.py | tnemisteam/cdf-steps | 78896eebd08ba9975a2dece97f73dca9aa781238 | [
"MIT"
] | null | null | null | emis_account/conf.py | tnemisteam/cdf-steps | 78896eebd08ba9975a2dece97f73dca9aa781238 | [
"MIT"
] | null | null | null | emis_account/conf.py | tnemisteam/cdf-steps | 78896eebd08ba9975a2dece97f73dca9aa781238 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils import importlib
from django.utils.translation import get_language_info
import pytz
from appconf import AppConf
def load_path_attr(path):
i = path.rfind(".")
mo... | 33.030769 | 95 | 0.736842 | from __future__ import unicode_literals
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils import importlib
from django.utils.translation import get_language_info
import pytz
from appconf import AppConf
def load_path_attr(path):
i = path.rfind(".")
mo... | true | true |
f747647fbd9801603a2bf9add0de1ac40d15360e | 87 | py | Python | example/Tensor/to_.py | j9263178/Cytnx | cf7fb1cff75c1cea14fbbc370fd8e4d86d0ddc8b | [
"Apache-2.0"
] | 11 | 2020-04-14T15:45:42.000Z | 2022-03-31T14:37:03.000Z | example/Tensor/to_.py | j9263178/Cytnx | cf7fb1cff75c1cea14fbbc370fd8e4d86d0ddc8b | [
"Apache-2.0"
] | 38 | 2019-08-02T15:15:51.000Z | 2022-03-04T19:07:02.000Z | example/Tensor/to_.py | j9263178/Cytnx | cf7fb1cff75c1cea14fbbc370fd8e4d86d0ddc8b | [
"Apache-2.0"
] | 7 | 2019-07-17T07:50:55.000Z | 2021-07-03T06:44:52.000Z | from cytnx import *
A = Tensor([3,4,5])
A.to_(Device.cuda+0);
print(A.device_str())
| 10.875 | 21 | 0.643678 | from cytnx import *
A = Tensor([3,4,5])
A.to_(Device.cuda+0);
print(A.device_str())
| true | true |
f74764998b64cb3499c9e028cc1c98cbc6265ff7 | 1,952 | py | Python | examples/plotting/server/boxplot.py | csaid/bokeh | 4312b2de1a15fb24884fcd97eaf6442bf8b4bd7b | [
"BSD-3-Clause"
] | 1 | 2021-07-27T07:41:35.000Z | 2021-07-27T07:41:35.000Z | examples/plotting/server/boxplot.py | csaid/bokeh | 4312b2de1a15fb24884fcd97eaf6442bf8b4bd7b | [
"BSD-3-Clause"
] | null | null | null | examples/plotting/server/boxplot.py | csaid/bokeh | 4312b2de1a15fb24884fcd97eaf6442bf8b4bd7b | [
"BSD-3-Clause"
] | null | null | null | # The plot server must be running
# Go to http://localhost:5006/bokeh to view this plot
import numpy as np
import pandas as pd
from bokeh.plotting import *
# Generate some synthetic time series for six different categories
cats = list("abcdef")
y = np.random.randn(2000)
g = np.random.choice(cats, 2000)
for i, l in en... | 28.705882 | 95 | 0.69416 |
import numpy as np
import pandas as pd
from bokeh.plotting import *
cats = list("abcdef")
y = np.random.randn(2000)
g = np.random.choice(cats, 2000)
for i, l in enumerate(cats):
y[g == l] += i // 2
df = pd.DataFrame(dict(score=y, group=g))
groups = df.groupby('group')
q1 = groups.quantile(q=0.25)
q2 = groups... | true | true |
f74764e648f3ff99e1848d4e86bd6769d5790fcd | 4,321 | py | Python | benchmarks_sphere/paper_jrn_parco_rexi_nonlinear/compare_wt_dt_vs_accuracy_galewsky/postprocessing_consolidate.py | valentinaschueller/sweet | 27e99c7a110c99deeadee70688c186d82b39ac90 | [
"MIT"
] | 6 | 2017-11-20T08:12:46.000Z | 2021-03-11T15:32:36.000Z | benchmarks_sphere/paper_jrn_parco_rexi_nonlinear/compare_wt_dt_vs_accuracy_galewsky/postprocessing_consolidate.py | valentinaschueller/sweet | 27e99c7a110c99deeadee70688c186d82b39ac90 | [
"MIT"
] | 4 | 2018-02-02T21:46:33.000Z | 2022-01-11T11:10:27.000Z | benchmarks_sphere/paper_jrn_parco_rexi_nonlinear/compare_wt_dt_vs_accuracy_galewsky/postprocessing_consolidate.py | valentinaschueller/sweet | 27e99c7a110c99deeadee70688c186d82b39ac90 | [
"MIT"
] | 12 | 2016-03-01T18:33:34.000Z | 2022-02-08T22:20:31.000Z | #! /usr/bin/env python3
import sys
import math
from SWEET import *
from mule.plotting.Plotting import *
from mule.postprocessing.JobsData import *
from mule.postprocessing.JobsDataConsolidate import *
sys.path.append('../')
import pretty_plotting as pp
sys.path.pop()
mule_plotting_usetex(False)
groups = ['runtime.... | 21.713568 | 129 | 0.635964 |
import sys
import math
from SWEET import *
from mule.plotting.Plotting import *
from mule.postprocessing.JobsData import *
from mule.postprocessing.JobsDataConsolidate import *
sys.path.append('../')
import pretty_plotting as pp
sys.path.pop()
mule_plotting_usetex(False)
groups = ['runtime.timestepping_method']
... | true | true |
f74765e3fda1055437e0f1dcf82a6fc99577ed57 | 832 | py | Python | python/mesh/generic/checksum.py | MinesJA/meshNetwork | 5ffada57c13049cb00c2996fe239cdff6edf6f17 | [
"NASA-1.3"
] | 133 | 2017-06-24T02:44:28.000Z | 2022-03-25T05:17:00.000Z | python/mesh/generic/checksum.py | MinesJA/meshNetwork | 5ffada57c13049cb00c2996fe239cdff6edf6f17 | [
"NASA-1.3"
] | null | null | null | python/mesh/generic/checksum.py | MinesJA/meshNetwork | 5ffada57c13049cb00c2996fe239cdff6edf6f17 | [
"NASA-1.3"
] | 33 | 2017-06-19T03:24:40.000Z | 2022-02-03T20:13:12.000Z | from struct import unpack
def calc8bitFletcherChecksum(msgBytes):
"""Calculate 8-bit Fletcher checksum for Li-1 radio packets.
Args:
msgBytes: Raw message bytes to calculate checksum of.
"""
ck_A = 0
ck_B = 0
for msgByte in msgBytes:
ck_A += int(msgByte)
ck_B += ck_A
... | 24.470588 | 64 | 0.655048 | from struct import unpack
def calc8bitFletcherChecksum(msgBytes):
ck_A = 0
ck_B = 0
for msgByte in msgBytes:
ck_A += int(msgByte)
ck_B += ck_A
return [ck_A & 0xFF, ck_B & 0xFF]
def compareChecksum(msgBytes, checksumBytes):
checksum = calc8bitFletcherChecksum(msgBytes)
msgChec... | true | true |
f74765f67d2a9809809fc4d6b90d3484da153e21 | 1,638 | py | Python | indra/databases/mondo_client.py | dianakolusheva/indra | 9dc1ad43457bf1a722384b00c84d18103d728594 | [
"BSD-2-Clause"
] | 136 | 2016-02-11T22:06:37.000Z | 2022-03-31T17:26:20.000Z | indra/databases/mondo_client.py | dianakolusheva/indra | 9dc1ad43457bf1a722384b00c84d18103d728594 | [
"BSD-2-Clause"
] | 748 | 2016-02-03T16:27:56.000Z | 2022-03-09T14:27:54.000Z | indra/databases/mondo_client.py | dianakolusheva/indra | 9dc1ad43457bf1a722384b00c84d18103d728594 | [
"BSD-2-Clause"
] | 56 | 2015-08-28T14:03:44.000Z | 2022-02-04T06:15:55.000Z | # -*- coding: utf-8 -*-
"""A client to the Monarch Disease Ontology (MONDO)."""
from typing import Optional
from indra.databases.obo_client import OboClient
_client = OboClient(prefix='mondo')
def get_name_from_id(mondo_id: str) -> Optional[str]:
"""Return the name corresponding to the given MONDO ID.
Pa... | 24.088235 | 78 | 0.659951 |
from typing import Optional
from indra.databases.obo_client import OboClient
_client = OboClient(prefix='mondo')
def get_name_from_id(mondo_id: str) -> Optional[str]:
return _client.get_name_from_id(mondo_id)
def get_id_from_name(mondo_name: str) -> Optional[str]:
return _client.get_id_from_name(mondo_... | true | true |
f74765f6de32fcd71aee29f64f7acb8210b4f00d | 5,407 | py | Python | assets/icon.py | jonfrs/IC-USP | 628c9ab2e2844e37aff17975929ee46946239483 | [
"Unlicense",
"MIT"
] | null | null | null | assets/icon.py | jonfrs/IC-USP | 628c9ab2e2844e37aff17975929ee46946239483 | [
"Unlicense",
"MIT"
] | 3 | 2021-09-23T13:40:19.000Z | 2021-09-25T19:57:07.000Z | assets/icon.py | jonfrs/IC-USP | 628c9ab2e2844e37aff17975929ee46946239483 | [
"Unlicense",
"MIT"
] | null | null | null | import atexit
import binascii
import os
import tempfile
iconhexdata = '00000100010032321000000000007007000016000000280000003200000064' \
'00000001000400000000000807000000000000000000000000000000000000' \
'00000000000080000080000000808000800000008000800080800000808080' \
'00c0c... | 67.5875 | 80 | 0.764564 | import atexit
import binascii
import os
import tempfile
iconhexdata = '00000100010032321000000000007007000016000000280000003200000064' \
'00000001000400000000000807000000000000000000000000000000000000' \
'00000000000080000080000000808000800000008000800080800000808080' \
'00c0c... | true | true |
f747668a1d4ffdf58b2f39ef7d7bbb8ac29b9a69 | 4,110 | py | Python | cvxpy/atoms/max.py | NunoEdgarGFlowHub/cvxpy | 43270fcc8af8fc4742f1b3519800b0074f2e6693 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | cvxpy/atoms/max.py | NunoEdgarGFlowHub/cvxpy | 43270fcc8af8fc4742f1b3519800b0074f2e6693 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | cvxpy/atoms/max.py | NunoEdgarGFlowHub/cvxpy | 43270fcc8af8fc4742f1b3519800b0074f2e6693 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | """
Copyright 2013 Steven Diamond
This file is part of CVXPY.
CVXPY is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
CVXPY is distributed i... | 30.220588 | 78 | 0.60438 |
from cvxpy.atoms.atom import Atom
from cvxpy.atoms.axis_atom import AxisAtom
import cvxpy.lin_ops.lin_utils as lu
import numpy as np
class max(AxisAtom):
def __init__(self, x, axis=None, keepdims=False):
super(max, self).__init__(x, axis=axis, keepdims=keepdims)
@Atom.numpy_numeric
def numeric(... | true | true |
f74766b394c7478c0db1c7e117d71d7afe454999 | 56 | py | Python | supplychainpy/distribution/air_frieght_transport.py | luisccalves/supplychainpy | 63a10b77ffdcc5bca71e815c70667c819d8f9af0 | [
"BSD-3-Clause"
] | 231 | 2016-05-30T02:34:45.000Z | 2022-03-28T17:00:29.000Z | supplychainpy/distribution/air_frieght_transport.py | luisccalves/supplychainpy | 63a10b77ffdcc5bca71e815c70667c819d8f9af0 | [
"BSD-3-Clause"
] | 77 | 2016-03-23T16:28:34.000Z | 2021-09-30T22:08:03.000Z | supplychainpy/distribution/air_frieght_transport.py | luisccalves/supplychainpy | 63a10b77ffdcc5bca71e815c70667c819d8f9af0 | [
"BSD-3-Clause"
] | 103 | 2016-08-10T19:53:09.000Z | 2022-03-16T16:34:38.000Z | class FreightPlane:
def __init__(self):
pass | 18.666667 | 23 | 0.642857 | class FreightPlane:
def __init__(self):
pass | true | true |
f74767552402b48bcd1d69237fd901733836e70f | 2,106 | py | Python | setup.py | scriptsboy/spotify-downloader | 44f64530efc9a125614e947381d37049408c3674 | [
"MIT"
] | 1 | 2019-01-24T10:47:42.000Z | 2019-01-24T10:47:42.000Z | setup.py | AlfredoSequeida/spotify-downloader | 42620838d03a1cdb6a33a799f2bb23c04ce0404a | [
"MIT"
] | null | null | null | setup.py | AlfredoSequeida/spotify-downloader | 42620838d03a1cdb6a33a799f2bb23c04ce0404a | [
"MIT"
] | 1 | 2018-12-11T02:45:42.000Z | 2018-12-11T02:45:42.000Z | from setuptools import setup
with open("README.md", "r") as f:
long_description = f.read()
import spotdl
setup(
# 'spotify-downloader' was already taken :/
name="spotdl",
# Tests are included automatically:
# https://docs.python.org/3.6/distutils/sourcedist.html#specifying-the-files-to-distribute... | 32.4 | 112 | 0.583571 | from setuptools import setup
with open("README.md", "r") as f:
long_description = f.read()
import spotdl
setup(
name="spotdl",
on=spotdl.__version__,
install_requires=[
"pathlib >= 1.0.1",
"youtube_dl >= 2017.9.26",
"pafy >= 0.5.3.1",
"spotipy >= 2.4.4",
... | true | true |
f747676dd9137268238231e5d311a67c9383f452 | 3,334 | py | Python | flake8_pantsbuild_test.py | Eric-Arellano/flake8-pantsbuild | 58a1d448ad0ec5266ed4d872edd1f859aa298cbe | [
"Apache-2.0"
] | 1 | 2020-10-28T07:43:31.000Z | 2020-10-28T07:43:31.000Z | flake8_pantsbuild_test.py | Eric-Arellano/flake8-pantsbuild | 58a1d448ad0ec5266ed4d872edd1f859aa298cbe | [
"Apache-2.0"
] | 4 | 2020-01-06T05:26:00.000Z | 2022-02-11T17:12:04.000Z | flake8_pantsbuild_test.py | Eric-Arellano/flake8-pantsbuild | 58a1d448ad0ec5266ed4d872edd1f859aa298cbe | [
"Apache-2.0"
] | 3 | 2020-01-05T19:53:59.000Z | 2021-12-03T22:25:12.000Z | # Copyright 2020 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import itertools
from textwrap import dedent
from flake8_pantsbuild import PB10, PB11, PB12, PB13, PB20, PB30
def test_pb_10(flake8dir) -> None:
template = dedent(
"""\
... | 25.450382 | 97 | 0.5021 |
import itertools
from textwrap import dedent
from flake8_pantsbuild import PB10, PB11, PB12, PB13, PB20, PB30
def test_pb_10(flake8dir) -> None:
template = dedent(
"""\
import os.path
class Example:
CONSTANT = "foo"
def foo(self, value):
retur... | true | true |
f747681ccdd41b36997741f185415fac14660c8d | 1,179 | py | Python | src/main/python/libraries/edge/writer/proxywriter.py | mayadebellis/incubator-sdap-edge | c0899e508a06d614aa58ec9e991443640ba39e65 | [
"Apache-2.0"
] | null | null | null | src/main/python/libraries/edge/writer/proxywriter.py | mayadebellis/incubator-sdap-edge | c0899e508a06d614aa58ec9e991443640ba39e65 | [
"Apache-2.0"
] | null | null | null | src/main/python/libraries/edge/writer/proxywriter.py | mayadebellis/incubator-sdap-edge | c0899e508a06d614aa58ec9e991443640ba39e65 | [
"Apache-2.0"
] | 1 | 2021-01-10T21:19:05.000Z | 2021-01-10T21:19:05.000Z | import logging
import requestresponder
from edge.httputility import HttpUtility
class ProxyWriter(requestresponder.RequestResponder):
def __init__(self, configFilePath):
super(ProxyWriter, self).__init__(configFilePath)
def get(self, requestHandler):
super(ProxyWriter, self).get(requestHandle... | 35.727273 | 96 | 0.661578 | import logging
import requestresponder
from edge.httputility import HttpUtility
class ProxyWriter(requestresponder.RequestResponder):
def __init__(self, configFilePath):
super(ProxyWriter, self).__init__(configFilePath)
def get(self, requestHandler):
super(ProxyWriter, self).get(requestHandle... | true | true |
f747685812d204b4b966d72ff30f7eb27b1e8c12 | 4,942 | py | Python | experiments/severity_scan_imagenet.py | damien911224/augmentation-corruption | 4cf22bd3be1d100635fb6cd41e9b71a6949b5dd0 | [
"MIT"
] | 25 | 2021-02-22T17:40:16.000Z | 2022-03-15T00:17:27.000Z | experiments/severity_scan_imagenet.py | damien911224/augmentation-corruption | 4cf22bd3be1d100635fb6cd41e9b71a6949b5dd0 | [
"MIT"
] | 2 | 2021-06-17T17:30:43.000Z | 2021-06-28T17:37:49.000Z | experiments/severity_scan_imagenet.py | damien911224/augmentation-corruption | 4cf22bd3be1d100635fb6cd41e9b71a6949b5dd0 | [
"MIT"
] | 10 | 2021-03-23T22:32:23.000Z | 2022-03-23T08:35:33.000Z | # 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 hydra
from hydra.utils import instantiate
import logging
from overlap.train_net import train_net
from overlap.test_net import test_net
... | 35.3 | 100 | 0.612707 |
import hydra
from hydra.utils import instantiate
import logging
from overlap.train_net import train_net
from overlap.test_net import test_net
import numpy as np
import torch
import pickle
import os
import omegaconf
from overlap.extract_features import extract_features
import submitit
log = logging.getLogger(__nam... | true | true |
f74768c592d82df9db76577eac041936b623c3ac | 1,216 | py | Python | application/commands.py | pachecobruno/python-ddd | 81812848a567d4605df346ef3630718d320706cc | [
"MIT"
] | null | null | null | application/commands.py | pachecobruno/python-ddd | 81812848a567d4605df346ef3630718d320706cc | [
"MIT"
] | null | null | null | application/commands.py | pachecobruno/python-ddd | 81812848a567d4605df346ef3630718d320706cc | [
"MIT"
] | null | null | null | from enum import Enum
from schematics.exceptions import DataError
from schematics.models import Model
from schematics.types import StringType, DateTimeType, DecimalType
class ResultStatus(str, Enum):
OK = 'ok'
PENDING = 'pending'
ERROR = 'error'
class CommandResult(object):
def __init__(self, statu... | 22.943396 | 83 | 0.634046 | from enum import Enum
from schematics.exceptions import DataError
from schematics.models import Model
from schematics.types import StringType, DateTimeType, DecimalType
class ResultStatus(str, Enum):
OK = 'ok'
PENDING = 'pending'
ERROR = 'error'
class CommandResult(object):
def __init__(self, statu... | true | true |
f7476a5182210a327217e92453521ab8734d71ac | 2,219 | py | Python | examples/example_normals.py | francisengelmann/PyViz3D | de4543cd437839f4a2193541b1029867d8ddc254 | [
"MIT"
] | 54 | 2020-06-15T01:01:40.000Z | 2022-01-25T21:36:44.000Z | examples/example_normals.py | francisengelmann/PyViz3D | de4543cd437839f4a2193541b1029867d8ddc254 | [
"MIT"
] | 1 | 2021-08-17T14:34:56.000Z | 2021-08-17T14:34:56.000Z | examples/example_normals.py | francisengelmann/pyviz3d | 51e49788e2aafc522920cbde7c48e962aca8e7b5 | [
"MIT"
] | 4 | 2020-06-24T09:46:18.000Z | 2021-12-09T08:56:16.000Z | import numpy as np
import pyviz3d.visualizer as viz
def create_color_palette():
return np.array([
(0, 0, 0),
(174, 199, 232), # wall
(152, 223, 138), # floor
(31, 119, 180), # cabinet
(255, 187, 120), # bed
(188, 189, 34), # chair
(140, 86, 75), # sofa
... | 29.197368 | 113 | 0.537179 | import numpy as np
import pyviz3d.visualizer as viz
def create_color_palette():
return np.array([
(0, 0, 0),
(174, 199, 232),
(152, 223, 138),
(31, 119, 180),
(255, 187, 120),
(188, 189, 34),
(140, 86, 75),
(255, 152, 150),
(214, 39,... | true | true |
f7476c4869408ef313b407bedb9ec1dfd6a1052e | 40,725 | py | Python | phono3py/cui/settings.py | lyuwen/phono3py | 9e2adffa6c07abb4bdbe4e4188c460cb8a0462fd | [
"BSD-3-Clause"
] | null | null | null | phono3py/cui/settings.py | lyuwen/phono3py | 9e2adffa6c07abb4bdbe4e4188c460cb8a0462fd | [
"BSD-3-Clause"
] | null | null | null | phono3py/cui/settings.py | lyuwen/phono3py | 9e2adffa6c07abb4bdbe4e4188c460cb8a0462fd | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
from phonopy.cui.settings import Settings, ConfParser, fracval
class Phono3pySettings(Settings):
def __init__(self):
Settings.__init__(self)
self._boundary_mfp = 1.0e6 # In micrometre. The default value is
# just set to avoid divergence.
... | 38.275376 | 87 | 0.600786 | import numpy as np
from phonopy.cui.settings import Settings, ConfParser, fracval
class Phono3pySettings(Settings):
def __init__(self):
Settings.__init__(self)
self._boundary_mfp = 1.0e6
self._coarse_mesh_shifts = None
self._const_ave_pp = None
... | true | true |
f7476d118d5b5200aa99d51ac469f8db64b443c9 | 4,494 | py | Python | test/test_web_transport.py | djzelenak/espa-web | dda9e1744675e62fce6ca5c500ce6b90e940fc7e | [
"Unlicense"
] | null | null | null | test/test_web_transport.py | djzelenak/espa-web | dda9e1744675e62fce6ca5c500ce6b90e940fc7e | [
"Unlicense"
] | null | null | null | test/test_web_transport.py | djzelenak/espa-web | dda9e1744675e62fce6ca5c500ce6b90e940fc7e | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
import unittest
from mock import patch
from mock import MagicMock
from flask import request
from StringIO import StringIO
from src.app import espaweb
from src.mocks import app as mock_app
from src.utils import User
class ApplicationTestCase(unittest.TestCase):
def setUp(self):
sel... | 35.952 | 92 | 0.639297 |
import unittest
from mock import patch
from mock import MagicMock
from flask import request
from StringIO import StringIO
from src.app import espaweb
from src.mocks import app as mock_app
from src.utils import User
class ApplicationTestCase(unittest.TestCase):
def setUp(self):
self.app = espaweb.test_... | true | true |
f7476e069d0024e5e5f18abb03294bc2d47136a0 | 313 | py | Python | schrutepy/schrutepy.py | bputman/schrutepy | 68f18a4e47a77bcfc92e0f76c3ba6bb135add65c | [
"MIT"
] | 23 | 2020-01-18T17:32:23.000Z | 2022-03-24T23:27:57.000Z | schrutepy/schrutepy.py | bputman/schrutepy | 68f18a4e47a77bcfc92e0f76c3ba6bb135add65c | [
"MIT"
] | 89 | 2020-01-17T23:29:44.000Z | 2022-01-24T20:16:39.000Z | schrutepy/schrutepy.py | bputman/schrutepy | 68f18a4e47a77bcfc92e0f76c3ba6bb135add65c | [
"MIT"
] | 6 | 2020-01-20T17:40:34.000Z | 2022-01-24T20:05:32.000Z | import pandas
def load_schrute():
"""
The entire script transcriptions from The Office in pandas dataframe format.
"""
full_path = "https://github.com/bradlindblad/schrutepy/raw/master/data/schrute.csv"
df = pandas.read_csv(full_path)
df = df.drop("Unnamed: 0", axis=1)
return df
| 20.866667 | 87 | 0.680511 | import pandas
def load_schrute():
full_path = "https://github.com/bradlindblad/schrutepy/raw/master/data/schrute.csv"
df = pandas.read_csv(full_path)
df = df.drop("Unnamed: 0", axis=1)
return df
| true | true |
f7476f5d319aa3aa28c366de8f746f0a5d7ea1ab | 22,594 | py | Python | ml/rl/test/gym/world_model/mdnrnn_gym.py | joshrose/Horizon | a2eb407b31a16560ae78aa6751eb83672a122a7e | [
"BSD-3-Clause"
] | 2 | 2021-01-11T18:16:32.000Z | 2021-11-30T09:34:58.000Z | ml/rl/test/gym/world_model/mdnrnn_gym.py | joshrose/Horizon | a2eb407b31a16560ae78aa6751eb83672a122a7e | [
"BSD-3-Clause"
] | null | null | null | ml/rl/test/gym/world_model/mdnrnn_gym.py | joshrose/Horizon | a2eb407b31a16560ae78aa6751eb83672a122a7e | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
"""
Learn a world model on gym environments
"""
import argparse
import json
import logging
import sys
from typing import Dict, Optional
import ml.rl.types as rlt
import numpy as np
import torch
from ml.rl.evaluation.world_mo... | 35.138414 | 88 | 0.631893 |
import argparse
import json
import logging
import sys
from typing import Dict, Optional
import ml.rl.types as rlt
import numpy as np
import torch
from ml.rl.evaluation.world_model_evaluator import (
FeatureImportanceEvaluator,
FeatureSensitivityEvaluator,
)
from ml.rl.json_serialize import json_to_object
fro... | true | true |
f7476fe572e6e49074eacad7bd57546fc4f88c7a | 20,317 | py | Python | model_service/model_service.py | Derikka/simulacrum | 99c4db9b15913c3c838532a86569645b3345fb83 | [
"BSD-3-Clause-LBNL"
] | 3 | 2019-01-17T20:52:41.000Z | 2019-04-29T19:01:37.000Z | model_service/model_service.py | Derikka/simulacrum | 99c4db9b15913c3c838532a86569645b3345fb83 | [
"BSD-3-Clause-LBNL"
] | 28 | 2019-02-16T01:25:55.000Z | 2021-01-27T19:30:31.000Z | model_service/model_service.py | Derikka/simulacrum | 99c4db9b15913c3c838532a86569645b3345fb83 | [
"BSD-3-Clause-LBNL"
] | 13 | 2019-02-22T19:38:06.000Z | 2022-03-21T20:10:44.000Z | #!/usr/bin/env python3
import os
import argparse
import sys
import pickle
import asyncio
import time
import numpy as np
import zmq
import pytao
from p4p.nt import NTTable
from p4p.server import Server as PVAServer
from p4p.server.asyncio import SharedPV
from zmq.asyncio import Context
import simulacrum
model_service_... | 50.041872 | 234 | 0.576266 |
import os
import argparse
import sys
import pickle
import asyncio
import time
import numpy as np
import zmq
import pytao
from p4p.nt import NTTable
from p4p.server import Server as PVAServer
from p4p.server.asyncio import SharedPV
from zmq.asyncio import Context
import simulacrum
model_service_dir = os.path.dirname(... | true | true |
f747705b79cf18241f46aa8154a08eeeddb3f71d | 4,095 | py | Python | basis/trimesh/io/stl.py | takuya-ki/wrs | f6e1009b94332504042fbde9b39323410394ecde | [
"MIT"
] | 23 | 2021-04-02T09:02:04.000Z | 2022-03-22T05:31:03.000Z | basis/trimesh/io/stl.py | takuya-ki/wrs | f6e1009b94332504042fbde9b39323410394ecde | [
"MIT"
] | 35 | 2021-04-12T09:41:05.000Z | 2022-03-26T13:32:46.000Z | basis/trimesh/io/stl.py | takuya-ki/wrs | f6e1009b94332504042fbde9b39323410394ecde | [
"MIT"
] | 16 | 2021-03-30T11:55:45.000Z | 2022-03-30T07:10:59.000Z | import numpy as np
from ..util import is_binary_file
# define a numpy datatype for the STL file
_stl_dtype = np.dtype([('normals', np.float32, (3)), ('vertices', np.float32, (3, 3)), ('attributes', np.uint16)])
_stl_dtype_header = np.dtype([('header', np.void, 80), ('face_count', np.int32)])
def load_stl(file_obj, ... | 36.5625 | 114 | 0.658608 | import numpy as np
from ..util import is_binary_file
_stl_dtype = np.dtype([('normals', np.float32, (3)), ('vertices', np.float32, (3, 3)), ('attributes', np.uint16)])
_stl_dtype_header = np.dtype([('header', np.void, 80), ('face_count', np.int32)])
def load_stl(file_obj, file_type=None):
if 'b' not in file_ob... | true | true |
f7477137b77e1f838e3c3e9c8021ffe3657bb0d4 | 138 | py | Python | appPortas/tests.py | ValerioMedeiros/SCEFA | 9028b575f8813e309c01061f0c1f58776e225ae7 | [
"MIT"
] | null | null | null | appPortas/tests.py | ValerioMedeiros/SCEFA | 9028b575f8813e309c01061f0c1f58776e225ae7 | [
"MIT"
] | 4 | 2018-10-23T21:41:11.000Z | 2019-02-16T16:34:39.000Z | appPortas/tests.py | ValerioMedeiros/SCEFA | 9028b575f8813e309c01061f0c1f58776e225ae7 | [
"MIT"
] | 3 | 2019-01-20T01:34:41.000Z | 2019-10-21T20:32:46.000Z | from appPortas.models import *
from appPonto.models import *
from datetime import datetime
pessoa = Pessoa.objects.get(id)
print(pessoa)
| 19.714286 | 31 | 0.797101 | from appPortas.models import *
from appPonto.models import *
from datetime import datetime
pessoa = Pessoa.objects.get(id)
print(pessoa)
| true | true |
f7477222468ff70fd3f1e29ef6c4a4e08e89fbea | 435 | py | Python | python/2018/day01.py | BastiHz/Advent_of_Code | e018b4d7499e760e9b761f87334f251d4adc05fe | [
"MIT"
] | 3 | 2020-12-10T20:01:03.000Z | 2021-01-03T09:24:59.000Z | python/2018/day01.py | BastiHz/Advent_of_Code | e018b4d7499e760e9b761f87334f251d4adc05fe | [
"MIT"
] | 3 | 2020-12-21T12:23:06.000Z | 2020-12-29T20:37:32.000Z | python/2018/day01.py | BastiHz/Advent_of_Code | e018b4d7499e760e9b761f87334f251d4adc05fe | [
"MIT"
] | null | null | null | # https://adventofcode.com/2018/day/1
with open("../../input/2018-01-input.txt") as file:
changes = [int(i) for i in file.read().splitlines()]
# part 1
print(sum(changes)) # 561
# part 2
frequency = 0
i = 0
seen = set()
while True:
for change in changes:
if frequency in seen:
break
... | 16.730769 | 56 | 0.590805 |
with open("../../input/2018-01-input.txt") as file:
changes = [int(i) for i in file.read().splitlines()]
print(sum(changes))
frequency = 0
i = 0
seen = set()
while True:
for change in changes:
if frequency in seen:
break
seen.add(frequency)
frequency += change
... | true | true |
f7477232dd597ebbb478d582b8bdf0fbea31c3ce | 1,401 | py | Python | run.py | hushyangqing/flsim | 1e0f955ba8b1227f6ba6cab300ec6adffc1cbbf6 | [
"Apache-2.0"
] | 97 | 2019-12-12T10:26:25.000Z | 2022-03-28T08:44:47.000Z | run.py | hushyangqing/flsim | 1e0f955ba8b1227f6ba6cab300ec6adffc1cbbf6 | [
"Apache-2.0"
] | 10 | 2020-07-24T13:40:00.000Z | 2022-03-26T18:48:27.000Z | run.py | hushyangqing/flsim | 1e0f955ba8b1227f6ba6cab300ec6adffc1cbbf6 | [
"Apache-2.0"
] | 41 | 2019-12-19T03:32:39.000Z | 2022-03-25T15:35:26.000Z | import argparse
import client
import config
import logging
import os
import server
# Set up parser
parser = argparse.ArgumentParser()
parser.add_argument('-c', '--config', type=str, default='./config.json',
help='Federated learning configuration file.')
parser.add_argument('-l', '--log', type=str,... | 27.470588 | 117 | 0.656674 | import argparse
import client
import config
import logging
import os
import server
parser = argparse.ArgumentParser()
parser.add_argument('-c', '--config', type=str, default='./config.json',
help='Federated learning configuration file.')
parser.add_argument('-l', '--log', type=str, default='INFO'... | true | true |
f74773bb55fd8bd468129de638101cd8bf7b2401 | 3,500 | py | Python | twitter_elections/sentiment_analysis/labeliseurs/old/autolabeliser.py | verycourt/Elections | b954c2bb23422e85d10074d41f7d2adc537a1766 | [
"MIT"
] | null | null | null | twitter_elections/sentiment_analysis/labeliseurs/old/autolabeliser.py | verycourt/Elections | b954c2bb23422e85d10074d41f7d2adc537a1766 | [
"MIT"
] | null | null | null | twitter_elections/sentiment_analysis/labeliseurs/old/autolabeliser.py | verycourt/Elections | b954c2bb23422e85d10074d41f7d2adc537a1766 | [
"MIT"
] | null | null | null | #!/usr/bin/python
#-*- coding: utf-8 -*-
import pymongo as pym
import re
def removeDuplicates():
client = pym.MongoClient()
c = client.tweet.tweet
duplicates = []
removepipe = [{"$group":{"_id":"$t_id", "dups":{"$push":"$_id"},"count":{"$sum":1}}},{"$match":{"count":{"$gt":1}}}]
try :
for ... | 40.229885 | 141 | 0.634 |
import pymongo as pym
import re
def removeDuplicates():
client = pym.MongoClient()
c = client.tweet.tweet
duplicates = []
removepipe = [{"$group":{"_id":"$t_id", "dups":{"$push":"$_id"},"count":{"$sum":1}}},{"$match":{"count":{"$gt":1}}}]
try :
for doc in c.aggregate(removepipe) :
... | true | true |
f7477544fa541d4bc682bc36ff9632891521f67b | 259 | py | Python | tests/unit/transport/test_systemssh.py | dmulyalin/scrapli_netconf | 7c9e5e74a1afac7955177db759e54d2211637d42 | [
"MIT"
] | 61 | 2020-05-17T19:57:25.000Z | 2022-03-30T01:10:32.000Z | tests/unit/transport/test_systemssh.py | dmulyalin/scrapli_netconf | 7c9e5e74a1afac7955177db759e54d2211637d42 | [
"MIT"
] | 79 | 2020-05-17T20:22:05.000Z | 2022-03-02T14:37:28.000Z | tests/unit/transport/test_systemssh.py | dmulyalin/scrapli_netconf | 7c9e5e74a1afac7955177db759e54d2211637d42 | [
"MIT"
] | 6 | 2021-01-07T16:45:28.000Z | 2022-02-11T19:31:49.000Z | from scrapli_netconf.driver import NetconfDriver
from scrapli_netconf.transport.plugins.system.transport import NetconfSystemTransport
def test_init():
conn = NetconfDriver(host="localhost")
assert isinstance(conn.transport, NetconfSystemTransport)
| 32.375 | 85 | 0.830116 | from scrapli_netconf.driver import NetconfDriver
from scrapli_netconf.transport.plugins.system.transport import NetconfSystemTransport
def test_init():
conn = NetconfDriver(host="localhost")
assert isinstance(conn.transport, NetconfSystemTransport)
| true | true |
f74775c24d19a95b1ff3498348f0a316a9ff73d8 | 576 | py | Python | revizor/utils.py | bureaucratic-labs/revizor | 725ba02cf70302ebea81207e68a8f93eaf863e1c | [
"MIT"
] | 15 | 2021-06-07T10:56:11.000Z | 2022-03-03T20:35:30.000Z | revizor/utils.py | bureaucratic-labs/revizor | 725ba02cf70302ebea81207e68a8f93eaf863e1c | [
"MIT"
] | 2 | 2021-10-02T11:13:45.000Z | 2022-01-20T07:12:28.000Z | revizor/utils.py | bureaucratic-labs/revizor | 725ba02cf70302ebea81207e68a8f93eaf863e1c | [
"MIT"
] | 6 | 2021-07-28T03:37:22.000Z | 2021-12-19T13:34:21.000Z | from functools import partial
from typing import List, Optional
from flair.data import Span
def _get_text_from_spans(text: str, spans: List[Span], tag: str) -> Optional[str]:
for span in spans:
if span.tag == tag:
return text[span.start_pos : span.end_pos]
return None
_get_type_from_spa... | 32 | 82 | 0.758681 | from functools import partial
from typing import List, Optional
from flair.data import Span
def _get_text_from_spans(text: str, spans: List[Span], tag: str) -> Optional[str]:
for span in spans:
if span.tag == tag:
return text[span.start_pos : span.end_pos]
return None
_get_type_from_spa... | true | true |
f74776c8a9ecb65b6e6598b64beb8af660ef5511 | 2,320 | py | Python | src/generate_instruction_default_field.py | CyberZHG/MIXAL | 06ebe91bb5abcc1ed4ff4af71809a1a41272c4f3 | [
"MIT"
] | 5 | 2020-07-15T16:16:06.000Z | 2021-07-14T04:26:36.000Z | src/generate_instruction_default_field.py | CyberZHG/MIXAL | 06ebe91bb5abcc1ed4ff4af71809a1a41272c4f3 | [
"MIT"
] | 1 | 2020-08-15T16:13:40.000Z | 2020-08-15T16:13:40.000Z | src/generate_instruction_default_field.py | CyberZHG/MIXAL | 06ebe91bb5abcc1ed4ff4af71809a1a41272c4f3 | [
"MIT"
] | 2 | 2020-08-16T00:41:48.000Z | 2021-05-23T18:43:33.000Z | FIELDS = {
'FADD': 6,
'FSUB': 6,
'FMUL': 6,
'FDIV': 6,
'NUM': 0, 'CHAR': 1, 'HLT': 2,
'SLA': 0, 'SRA': 1, 'SLAX': 2, 'SRAX': 3, 'SLC': 4, 'SRC': 5,
'STJ': 2,
'JMP': 0, 'JSJ': 1, 'JOV': 2, 'JNOV': 3, 'JL': 4, 'JE': 5, 'JG': 6, 'JGE': 7, 'JNE': 8, 'JLE': 9,
'JAN': 0, 'JAZ': 1, 'JAP': 2... | 35.692308 | 101 | 0.423707 | FIELDS = {
'FADD': 6,
'FSUB': 6,
'FMUL': 6,
'FDIV': 6,
'NUM': 0, 'CHAR': 1, 'HLT': 2,
'SLA': 0, 'SRA': 1, 'SLAX': 2, 'SRAX': 3, 'SLC': 4, 'SRC': 5,
'STJ': 2,
'JMP': 0, 'JSJ': 1, 'JOV': 2, 'JNOV': 3, 'JL': 4, 'JE': 5, 'JG': 6, 'JGE': 7, 'JNE': 8, 'JLE': 9,
'JAN': 0, 'JAZ': 1, 'JAP': 2... | true | true |
f74776cc3735f58a916c18f01991db1ae67c284a | 9,585 | py | Python | third_party/blink/renderer/bindings/scripts/bind_gen/path_manager.py | Ron423c/chromium | 2edf7b980065b648f8b2a6e52193d83832fe36b7 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | third_party/blink/renderer/bindings/scripts/bind_gen/path_manager.py | Ron423c/chromium | 2edf7b980065b648f8b2a6e52193d83832fe36b7 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | third_party/blink/renderer/bindings/scripts/bind_gen/path_manager.py | Ron423c/chromium | 2edf7b980065b648f8b2a6e52193d83832fe36b7 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2021-03-07T14:20:02.000Z | 2021-03-07T14:20:02.000Z | # Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os.path
import posixpath
import web_idl
from . import name_style
from .blink_v8_bridge import blink_class_name
class PathManager(object):
"""
... | 40.273109 | 136 | 0.683255 |
import os.path
import posixpath
import web_idl
from . import name_style
from .blink_v8_bridge import blink_class_name
class PathManager(object):
_REQUIRE_INIT_MESSAGE = ("PathManager.init must be called in advance.")
_is_initialized = False
@classmethod
def init(cls, root_src_dir, root_gen_dir... | true | true |
f747798d967e7365323e4a1a767e42f2a3509274 | 1,022 | py | Python | tests/capture/aes/test_control.py | kralka/scaaml | f47e028dad6bc74eb480cbfae83724c1057caf39 | [
"Apache-2.0"
] | null | null | null | tests/capture/aes/test_control.py | kralka/scaaml | f47e028dad6bc74eb480cbfae83724c1057caf39 | [
"Apache-2.0"
] | null | null | null | tests/capture/aes/test_control.py | kralka/scaaml | f47e028dad6bc74eb480cbfae83724c1057caf39 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 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, ... | 36.5 | 74 | 0.736791 |
from unittest.mock import MagicMock
from scaaml.capture.aes.control import CWControl
def test_control():
chip_id = 314159
with CWControl(chip_id=chip_id, scope_io=MagicMock()) as control:
assert control.chip_id == chip_id
assert control._scope_io.tio1 == "serial_rx"
asse... | true | true |
f7477a7f692dd8283a2c24c536bdde781edc7d3c | 1,150 | py | Python | PermutationSequence60.py | Bit64L/LeetCode-Python- | 64847cbb1adcaca4561b949e8acc52e8e031a6cb | [
"MIT"
] | null | null | null | PermutationSequence60.py | Bit64L/LeetCode-Python- | 64847cbb1adcaca4561b949e8acc52e8e031a6cb | [
"MIT"
] | null | null | null | PermutationSequence60.py | Bit64L/LeetCode-Python- | 64847cbb1adcaca4561b949e8acc52e8e031a6cb | [
"MIT"
] | null | null | null | class Solution:
def getPermutation(self, n, k):
import math
nums = range(1, n + 1)
ans = ''
k -= 1
while n > 0:
n -= 1
index, k = divmod(k, math.factorial(n))
ans += str(nums[index])
nums.remove(nums[index])
return ans
... | 23.958333 | 51 | 0.405217 | class Solution:
def getPermutation(self, n, k):
import math
nums = range(1, n + 1)
ans = ''
k -= 1
while n > 0:
n -= 1
index, k = divmod(k, math.factorial(n))
ans += str(nums[index])
nums.remove(nums[index])
return ans
... | true | true |
f7477bed0d9c25d89f40c12c17c525e0937b3a6a | 1,776 | py | Python | run_tests.py | pj1031999/mimiker | ed701132b45dbb6b3b94121cd1ef3820bf4781aa | [
"BSD-3-Clause"
] | 185 | 2016-06-24T16:40:13.000Z | 2022-03-24T18:07:18.000Z | run_tests.py | pj1031999/mimiker | ed701132b45dbb6b3b94121cd1ef3820bf4781aa | [
"BSD-3-Clause"
] | 586 | 2016-04-21T22:54:18.000Z | 2022-03-25T18:34:01.000Z | run_tests.py | pj1031999/mimiker | ed701132b45dbb6b3b94121cd1ef3820bf4781aa | [
"BSD-3-Clause"
] | 57 | 2016-06-03T14:02:11.000Z | 2022-03-12T03:18:54.000Z | #!/usr/bin/env -S python3 -u
import argparse
import os
import random
import shutil
import signal
import subprocess
import sys
N_SIMPLE = 10
DEFAULT_TIMEOUT = 40
REPEAT = 5
def setup_terminal():
cols, rows = shutil.get_terminal_size(fallback=(132, 43))
os.environ['COLUMNS'] = str(cols)
os.environ['LINE... | 28.190476 | 78 | 0.596284 |
import argparse
import os
import random
import shutil
import signal
import subprocess
import sys
N_SIMPLE = 10
DEFAULT_TIMEOUT = 40
REPEAT = 5
def setup_terminal():
cols, rows = shutil.get_terminal_size(fallback=(132, 43))
os.environ['COLUMNS'] = str(cols)
os.environ['LINES'] = str(rows)
if sys.... | true | true |
f7477cd4ffe0ee3eee33e3043bf0f1a5de70b708 | 137 | py | Python | src/pyprobe/sensors/pegasus/__init__.py | dittert/pyprobe | 1b0d0e403645ed204332c70c8a89e094f860023a | [
"Apache-2.0"
] | null | null | null | src/pyprobe/sensors/pegasus/__init__.py | dittert/pyprobe | 1b0d0e403645ed204332c70c8a89e094f860023a | [
"Apache-2.0"
] | null | null | null | src/pyprobe/sensors/pegasus/__init__.py | dittert/pyprobe | 1b0d0e403645ed204332c70c8a89e094f860023a | [
"Apache-2.0"
] | null | null | null | __author__ = 'Dirk Dittert'
from sensor_phy_drive import PegasusPhysicalDriveSensor
from sensor_enclosure import PegasusEnclosureSensor
| 27.4 | 55 | 0.883212 | __author__ = 'Dirk Dittert'
from sensor_phy_drive import PegasusPhysicalDriveSensor
from sensor_enclosure import PegasusEnclosureSensor
| true | true |
f7477d8fbf35208c1e5a0fc8ed2d62b5eb821aa2 | 3,398 | py | Python | setup.py | szmmm/speechchain | 909724c6f305588a52958f64f584ad21696b5173 | [
"Apache-2.0"
] | null | null | null | setup.py | szmmm/speechchain | 909724c6f305588a52958f64f584ad21696b5173 | [
"Apache-2.0"
] | null | null | null | setup.py | szmmm/speechchain | 909724c6f305588a52958f64f584ad21696b5173 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
from distutils.version import LooseVersion
import os
import pip
from setuptools import find_packages
from setuptools import setup
import sys
if LooseVersion(sys.version) < LooseVersion('3.6'):
raise RuntimeError(
'ESPnet requires Python>=3.6, '
'but your Python is {}'.format(... | 33.98 | 80 | 0.586816 |
from distutils.version import LooseVersion
import os
import pip
from setuptools import find_packages
from setuptools import setup
import sys
if LooseVersion(sys.version) < LooseVersion('3.6'):
raise RuntimeError(
'ESPnet requires Python>=3.6, '
'but your Python is {}'.format(sys.version))
if Loos... | true | true |
f7477e112d8e0bf73e59481fc630e13dd05bf706 | 575 | py | Python | backend/migrations/0005_auto_20210301_0957.py | WilliamOrringe/uthos | e59430f277677158d957ae91226198bd7a43301d | [
"MIT"
] | 1 | 2021-03-04T11:51:43.000Z | 2021-03-04T11:51:43.000Z | backend/migrations/0005_auto_20210301_0957.py | WilliamOrringe/uthos | e59430f277677158d957ae91226198bd7a43301d | [
"MIT"
] | 23 | 2021-03-04T16:18:45.000Z | 2021-03-11T10:36:38.000Z | backend/migrations/0005_auto_20210301_0957.py | WilliamOrringe/uthos | e59430f277677158d957ae91226198bd7a43301d | [
"MIT"
] | null | null | null | # Generated by Django 3.0.6 on 2021-03-01 09:57
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("backend", "0004_pointsgained_comment"),
]
operations = [
migrations.AddField(
model_name="community",
name="colour",... | 23.958333 | 74 | 0.584348 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("backend", "0004_pointsgained_comment"),
]
operations = [
migrations.AddField(
model_name="community",
name="colour",
field=models.CharField(blank=True,... | true | true |
f7477e3998de6426b81794143d9110b7cece84a9 | 3,474 | py | Python | tests/test_plan7/test_profile.py | althonos/pyhmmer | eb6fe7c0e74557e0ae9d647693711583d2d86b68 | [
"MIT"
] | 26 | 2020-11-10T22:57:49.000Z | 2022-03-24T16:58:55.000Z | tests/test_plan7/test_profile.py | althonos/pyhmmer | eb6fe7c0e74557e0ae9d647693711583d2d86b68 | [
"MIT"
] | 13 | 2020-11-12T11:41:08.000Z | 2022-03-09T18:17:48.000Z | tests/test_plan7/test_profile.py | althonos/pyhmmer | eb6fe7c0e74557e0ae9d647693711583d2d86b68 | [
"MIT"
] | 2 | 2021-04-04T05:13:07.000Z | 2021-11-30T09:11:23.000Z | import copy
import io
import itertools
import os
import shutil
import unittest
import tempfile
import pkg_resources
import pyhmmer
from pyhmmer.errors import EaselError, AlphabetMismatch
from pyhmmer.easel import Alphabet, SequenceFile
from pyhmmer.plan7 import HMM, HMMFile, Profile, Background
class TestProfile(uni... | 34.74 | 96 | 0.661197 | import copy
import io
import itertools
import os
import shutil
import unittest
import tempfile
import pkg_resources
import pyhmmer
from pyhmmer.errors import EaselError, AlphabetMismatch
from pyhmmer.easel import Alphabet, SequenceFile
from pyhmmer.plan7 import HMM, HMMFile, Profile, Background
class TestProfile(uni... | true | true |
f7477f596be4c1f1cd501f2786dece36ca96b8c7 | 115 | py | Python | myanimelist_forum_queue/forum_queue/urls.py | PythonCoderAS/myanimelist-forum-queue | 95ba796db2499432aceecd8ab05d93b3ddc2563f | [
"MIT"
] | null | null | null | myanimelist_forum_queue/forum_queue/urls.py | PythonCoderAS/myanimelist-forum-queue | 95ba796db2499432aceecd8ab05d93b3ddc2563f | [
"MIT"
] | null | null | null | myanimelist_forum_queue/forum_queue/urls.py | PythonCoderAS/myanimelist-forum-queue | 95ba796db2499432aceecd8ab05d93b3ddc2563f | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
urlpatterns = [
path('', views.index_view, name='index'),
]
| 14.375 | 45 | 0.678261 | from django.urls import path
from . import views
urlpatterns = [
path('', views.index_view, name='index'),
]
| true | true |
f74780176d3c6cb1a1ac89886bb91c29b187f401 | 1,244 | py | Python | test/test_delete_record.py | Eduard-z/SF_project_pytest | 1dd39c36a9d2c7a231e5933cbeb834209e68c353 | [
"Apache-2.0"
] | null | null | null | test/test_delete_record.py | Eduard-z/SF_project_pytest | 1dd39c36a9d2c7a231e5933cbeb834209e68c353 | [
"Apache-2.0"
] | null | null | null | test/test_delete_record.py | Eduard-z/SF_project_pytest | 1dd39c36a9d2c7a231e5933cbeb834209e68c353 | [
"Apache-2.0"
] | null | null | null | import pytest
import allure
from api_requests.preconditions import Preconditions
@allure.severity(allure.severity_level.NORMAL)
@pytest.mark.account
@pytest.mark.delete
def test_delete_account(app):
app.global_header.navigate_to_object('Account', 'Account')
app.list_view_page.open_list_view('All Accounts')
... | 36.588235 | 102 | 0.774116 | import pytest
import allure
from api_requests.preconditions import Preconditions
@allure.severity(allure.severity_level.NORMAL)
@pytest.mark.account
@pytest.mark.delete
def test_delete_account(app):
app.global_header.navigate_to_object('Account', 'Account')
app.list_view_page.open_list_view('All Accounts')
... | true | true |
f74780fdc09f0769bb955bedf137ccc8f745fa68 | 1,028 | py | Python | tests/test_master_utils.py | tcc-unb-fga/debile | 84accc5fe14e9f8d0c1df1c3c32afaab19b0dcbc | [
"MIT"
] | null | null | null | tests/test_master_utils.py | tcc-unb-fga/debile | 84accc5fe14e9f8d0c1df1c3c32afaab19b0dcbc | [
"MIT"
] | null | null | null | tests/test_master_utils.py | tcc-unb-fga/debile | 84accc5fe14e9f8d0c1df1c3c32afaab19b0dcbc | [
"MIT"
] | null | null | null | import debile.master.utils as utils
import unittest
import mock
class MasterUtilsTestCase(unittest.TestCase):
def test_init_config(self):
config = utils._init_config('tests/resources/master.yaml')
self.assertEquals(config['database'], 'sqlite:////srv/debile/debile.db')
self.assertIsNotNo... | 32.125 | 80 | 0.695525 | import debile.master.utils as utils
import unittest
import mock
class MasterUtilsTestCase(unittest.TestCase):
def test_init_config(self):
config = utils._init_config('tests/resources/master.yaml')
self.assertEquals(config['database'], 'sqlite:////srv/debile/debile.db')
self.assertIsNotNo... | true | true |
f747810e183e4d13e1534c2774f3980f8619887a | 6,184 | py | Python | Python/DDR.py | NathanLoPresto/UI-for-servicing-OP-AMPs | 75605aa8b2315c1bbf3e7eee0f8ad706fa7e4f14 | [
"MIT"
] | 1 | 2021-11-14T06:11:04.000Z | 2021-11-14T06:11:04.000Z | Python/DDR.py | NathanLoPresto/UI-for-servicing-OP-AMPs | 75605aa8b2315c1bbf3e7eee0f8ad706fa7e4f14 | [
"MIT"
] | null | null | null | Python/DDR.py | NathanLoPresto/UI-for-servicing-OP-AMPs | 75605aa8b2315c1bbf3e7eee0f8ad706fa7e4f14 | [
"MIT"
] | null | null | null | import ok
from fpga import FPGA
import numpy as np
import time
import matplotlib.pyplot as plot
import struct
from collections import namedtuple
BLOCK_SIZE = (16384)
WRITE_SIZE=(8*1024*1024)
READ_SIZE = (8*1024*1024)
g_nMemSize = (8*1024*1024)
sample_size = (524288)
ep = namedtuple('ep', 'addr bits type')
control = ... | 34.355556 | 119 | 0.657018 | import ok
from fpga import FPGA
import numpy as np
import time
import matplotlib.pyplot as plot
import struct
from collections import namedtuple
BLOCK_SIZE = (16384)
WRITE_SIZE=(8*1024*1024)
READ_SIZE = (8*1024*1024)
g_nMemSize = (8*1024*1024)
sample_size = (524288)
ep = namedtuple('ep', 'addr bits type')
control = ... | true | true |
f74781a288fa3baece671e1ca5d6940b2d12616a | 6,428 | py | Python | database/postgresql_utils.py | nishanthsolomon/postgresql-database | edba96867c1f7d4b97a62fc9d557056cb9bf2065 | [
"MIT"
] | null | null | null | database/postgresql_utils.py | nishanthsolomon/postgresql-database | edba96867c1f7d4b97a62fc9d557056cb9bf2065 | [
"MIT"
] | null | null | null | database/postgresql_utils.py | nishanthsolomon/postgresql-database | edba96867c1f7d4b97a62fc9d557056cb9bf2065 | [
"MIT"
] | null | null | null | import psycopg2
from database.config import config
from database.postgresql_tables import Tables
import logging
logger = logging.getLogger(__name__)
class PostgresqlUtils():
INSERT_COMMAND = 'INSERT INTO {} ({}) VALUES({}) RETURNING {}'
SELECT_COMMAND_CONDITION = 'SELECT {} FROM {} {}'
WHERE_CLAUSE = 'W... | 34.745946 | 114 | 0.641257 | import psycopg2
from database.config import config
from database.postgresql_tables import Tables
import logging
logger = logging.getLogger(__name__)
class PostgresqlUtils():
INSERT_COMMAND = 'INSERT INTO {} ({}) VALUES({}) RETURNING {}'
SELECT_COMMAND_CONDITION = 'SELECT {} FROM {} {}'
WHERE_CLAUSE = 'W... | true | true |
f74781df97284361ef15250ece7c89f4ca01a570 | 18,677 | py | Python | google/cloud/bigquery/dbapi/cursor.py | Topolytics/python-bigquery | aa74f8ee0c7b3232ce268b1de31b010b5e94e8dc | [
"Apache-2.0"
] | null | null | null | google/cloud/bigquery/dbapi/cursor.py | Topolytics/python-bigquery | aa74f8ee0c7b3232ce268b1de31b010b5e94e8dc | [
"Apache-2.0"
] | null | null | null | google/cloud/bigquery/dbapi/cursor.py | Topolytics/python-bigquery | aa74f8ee0c7b3232ce268b1de31b010b5e94e8dc | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 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, ... | 35.173258 | 93 | 0.621245 |
import collections
from collections import abc as collections_abc
import copy
import logging
import re
try:
from google.cloud.bigquery_storage import ArrowSerializationOptions
except ImportError:
_ARROW_COMPRESSION_SUPPORT = False
else:
_ARROW_COMPRESSION_SUPPORT = True
from google.clo... | true | true |
f74782284ea50075fdce0e92666ab04a64a74c2e | 3,182 | py | Python | recbole/data/dataset/xgboost_dataset.py | Zephyr-29/RecBole | e8300611765c947ce904f29c610b188033ec8da8 | [
"MIT"
] | 1 | 2021-02-03T11:07:05.000Z | 2021-02-03T11:07:05.000Z | recbole/data/dataset/xgboost_dataset.py | Zephyr-29/RecBole | e8300611765c947ce904f29c610b188033ec8da8 | [
"MIT"
] | null | null | null | recbole/data/dataset/xgboost_dataset.py | Zephyr-29/RecBole | e8300611765c947ce904f29c610b188033ec8da8 | [
"MIT"
] | null | null | null | # @Time : 2020/12/17
# @Author : Chen Yang
# @Email : 254170321@qq.com
"""
recbole.data.xgboost_dataset
##########################
"""
from recbole.data.dataset import Dataset
from recbole.utils import FeatureType
class XgboostDataset(Dataset):
""":class:`XgboostDataset` is based on :class:`~recbole.data.dat... | 33.145833 | 104 | 0.576053 |
from recbole.data.dataset import Dataset
from recbole.utils import FeatureType
class XgboostDataset(Dataset):
def __init__(self, config, saved_dataset=None):
super().__init__(config, saved_dataset=saved_dataset)
def _judge_token_and_convert(self, feat):
col_list = []
fo... | true | true |
f747829e40c6f4adc0f68558087c07aefa48ed79 | 9,407 | py | Python | lib/SneddonContigFilter2/SneddonContigFilter2Impl.py | msneddon/ContigFilterTest2 | 5aaa4a9a7b76c17bf9ad81e1e5a2bed856240a61 | [
"MIT"
] | null | null | null | lib/SneddonContigFilter2/SneddonContigFilter2Impl.py | msneddon/ContigFilterTest2 | 5aaa4a9a7b76c17bf9ad81e1e5a2bed856240a61 | [
"MIT"
] | null | null | null | lib/SneddonContigFilter2/SneddonContigFilter2Impl.py | msneddon/ContigFilterTest2 | 5aaa4a9a7b76c17bf9ad81e1e5a2bed856240a61 | [
"MIT"
] | null | null | null | #BEGIN_HEADER
# The header block is where all import statments should live
import sys
import traceback
import uuid
from pprint import pprint, pformat
from biokbase.workspace.client import Workspace as workspaceService
#END_HEADER
class SneddonContigFilter2:
'''
Module Name:
SneddonContigFilter2
Module... | 44.372642 | 114 | 0.576379 |
import sys
import traceback
import uuid
from pprint import pprint, pformat
from biokbase.workspace.client import Workspace as workspaceService
class SneddonContigFilter2:
_length' not in params:
raise ValueError('Parameter min_length is not set in input arguments')
min_length_orig = pa... | true | true |
f747832e3602750bde76f09a8a582e37ef9d487c | 3,005 | py | Python | improver/cli/wind_gust_diagnostic.py | ddlddl58/improver | 37b5b12491a77feccb03e33813efe8ffdebfa25d | [
"BSD-3-Clause"
] | 1 | 2021-05-01T22:59:15.000Z | 2021-05-01T22:59:15.000Z | improver/cli/wind_gust_diagnostic.py | ddlddl58/improver | 37b5b12491a77feccb03e33813efe8ffdebfa25d | [
"BSD-3-Clause"
] | null | null | null | improver/cli/wind_gust_diagnostic.py | ddlddl58/improver | 37b5b12491a77feccb03e33813efe8ffdebfa25d | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# (C) British Crown Copyright 2017-2019 Met Office.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the ... | 41.164384 | 82 | 0.723794 |
from improver import cli
@cli.clizefy
@cli.with_output
def process(
wind_gust: cli.inputcube,
wind_speed: cli.inputcube,
*,
wind_gust_percentile: float = 50.0,
wind_speed_percentile: float = 95.0,
):
from improver.wind_calculations.wind_gust_diagnostic import Wi... | true | true |
f7478358a84c140cc15cdff55069a511d6356a68 | 4,822 | py | Python | pluto/test/test.py | chalant/pluto | e7bfd35a2c1fc0e0753bd2f840b0a4385b5124fc | [
"Apache-2.0"
] | null | null | null | pluto/test/test.py | chalant/pluto | e7bfd35a2c1fc0e0753bd2f840b0a4385b5124fc | [
"Apache-2.0"
] | null | null | null | pluto/test/test.py | chalant/pluto | e7bfd35a2c1fc0e0753bd2f840b0a4385b5124fc | [
"Apache-2.0"
] | null | null | null | import logging
from sqlalchemy import create_engine
import pandas as pd
from numpy import testing
import numpy as np
from dev import strategy_store, events
from pluto import examples
from pluto.utils import stream
from pluto.control.loop import simulation_loop
from pluto.control.processes import processes
from ... | 26.494505 | 96 | 0.603484 | import logging
from sqlalchemy import create_engine
import pandas as pd
from numpy import testing
import numpy as np
from dev import strategy_store, events
from pluto import examples
from pluto.utils import stream
from pluto.control.loop import simulation_loop
from pluto.control.processes import processes
from ... | true | true |
f74783a59fb0fdbccc9ad3811253c7f13e936224 | 2,437 | py | Python | ClsKL/train/train_kl.py | Tommy-Ngx/AutoGradingOA | 5e69bd38abaf01f03d8d837da68701a86bac1bb0 | [
"MIT"
] | 14 | 2019-10-29T10:48:43.000Z | 2022-03-16T08:35:40.000Z | ClsKL/train/train_kl.py | Tommy-Ngx/AutoGradingOA | 5e69bd38abaf01f03d8d837da68701a86bac1bb0 | [
"MIT"
] | 4 | 2020-03-06T14:49:59.000Z | 2021-11-11T07:48:36.000Z | ClsKL/train/train_kl.py | Tommy-Ngx/AutoGradingOA | 5e69bd38abaf01f03d8d837da68701a86bac1bb0 | [
"MIT"
] | 8 | 2019-09-19T04:59:04.000Z | 2022-01-31T12:03:46.000Z | # -*- coding: utf-8 -*-
import os, sys, pdb
import argparse
import torch
import numpy as np
FILE_PATH = os.path.abspath(__file__)
PRJ_PATH = os.path.dirname(os.path.dirname(FILE_PATH))
sys.path.append(PRJ_PATH)
from utils.loader import data_load
# from utils.model import resnet
from utils.model import cls_model
fro... | 38.078125 | 107 | 0.643824 |
import os, sys, pdb
import argparse
import torch
import numpy as np
FILE_PATH = os.path.abspath(__file__)
PRJ_PATH = os.path.dirname(os.path.dirname(FILE_PATH))
sys.path.append(PRJ_PATH)
from utils.loader import data_load
from utils.model import cls_model
from utils.train_eng import train_model
from utils.eval_en... | true | true |
f747845ff5aa418dbf2406302232103758d31e19 | 16,394 | py | Python | pymemcache/test/test_client_hash.py | martinnj/pymemcache | 79d98d23cd589556b0dc51a7d10ea338e90a944e | [
"Apache-2.0"
] | 618 | 2015-01-09T14:26:14.000Z | 2022-03-29T11:04:47.000Z | pymemcache/test/test_client_hash.py | pinterest/pymemcache | 79d98d23cd589556b0dc51a7d10ea338e90a944e | [
"Apache-2.0"
] | 211 | 2015-02-24T14:45:57.000Z | 2022-03-30T23:04:20.000Z | pymemcache/test/test_client_hash.py | martinnj/pymemcache | 79d98d23cd589556b0dc51a7d10ea338e90a944e | [
"Apache-2.0"
] | 180 | 2015-03-05T02:02:31.000Z | 2022-03-22T16:24:47.000Z | from pymemcache.client.hash import HashClient
from pymemcache.client.base import Client, PooledClient
from pymemcache.exceptions import MemcacheError, MemcacheUnknownError
from pymemcache import pool
from .test_client import ClientTestMixin, MockSocket
import unittest
import os
import pytest
from unittest import mock
... | 34.22547 | 74 | 0.581676 | from pymemcache.client.hash import HashClient
from pymemcache.client.base import Client, PooledClient
from pymemcache.exceptions import MemcacheError, MemcacheUnknownError
from pymemcache import pool
from .test_client import ClientTestMixin, MockSocket
import unittest
import os
import pytest
from unittest import mock
... | true | true |
f74784ec8432058cc80edf5c3cdb3e1d4655e4b6 | 112,034 | py | Python | Cinder/Mitaka/rest_client.py | bingyanh/OpenStack_Driver | 8c94f6f86a5ebb1e663aa73df0847cfad09d2960 | [
"Apache-2.0"
] | null | null | null | Cinder/Mitaka/rest_client.py | bingyanh/OpenStack_Driver | 8c94f6f86a5ebb1e663aa73df0847cfad09d2960 | [
"Apache-2.0"
] | null | null | null | Cinder/Mitaka/rest_client.py | bingyanh/OpenStack_Driver | 8c94f6f86a5ebb1e663aa73df0847cfad09d2960 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2016 Huawei Technologies Co., Ltd.
# 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
#
# ... | 38.354673 | 79 | 0.567122 |
import json
import netaddr
import re
import requests
import six
import threading
import time
from oslo_concurrency import lockutils
from oslo_log import log as logging
from oslo_utils import excutils
from oslo_utils import strutils
from requests.adapters import HTTPAdapter
from cinder import exception
... | true | true |
f7478567a3d5fd9f327aa7260bc0a6609c186e53 | 4,506 | py | Python | ibkr_app.py | hyw2/Homework1 | e1c5d8e343ea11909d9f79bdf33a7d604cf085a8 | [
"MIT"
] | null | null | null | ibkr_app.py | hyw2/Homework1 | e1c5d8e343ea11909d9f79bdf33a7d604cf085a8 | [
"MIT"
] | null | null | null | ibkr_app.py | hyw2/Homework1 | e1c5d8e343ea11909d9f79bdf33a7d604cf085a8 | [
"MIT"
] | null | null | null | from ib_insync import *
from os import listdir, remove
from time import sleep
import pickle
import pandas as pd
from helper_functions import *
# Define your variables here ###########################################################################################
sampling_rate = 1 # How often, in seconds, to check for... | 48.451613 | 120 | 0.654239 | from ib_insync import *
from os import listdir, remove
from time import sleep
import pickle
import pandas as pd
from helper_functions import *
| true | true |
f7478667df1055012da1ae00fe7195fd4dc9e8bf | 2,671 | py | Python | fabfile.py | ArtemioRicardo/openxc-android | 64a59533fd0a74b65a2159e329c71f99b7c40491 | [
"BSD-3-Clause"
] | 1 | 2019-07-04T12:12:57.000Z | 2019-07-04T12:12:57.000Z | fabfile.py | ArtemioRicardo/openxc-android | 64a59533fd0a74b65a2159e329c71f99b7c40491 | [
"BSD-3-Clause"
] | null | null | null | fabfile.py | ArtemioRicardo/openxc-android | 64a59533fd0a74b65a2159e329c71f99b7c40491 | [
"BSD-3-Clause"
] | 1 | 2018-04-02T11:16:51.000Z | 2018-04-02T11:16:51.000Z | #!/usr/bin/env python
import os
from fabric.api import * # noqa
from fabric.colors import green, yellow
from fabric.contrib.console import confirm
from prettyprint import pp
import re
VERSION_PATTERN = r'^v\d+(\.\d+)+?$'
env.releases_directory = "release"
env.root_dir = os.path.abspath(os.path.dirname(__file__))
en... | 30.352273 | 74 | 0.633096 |
import os
from fabric.api import *
from fabric.colors import green, yellow
from fabric.contrib.console import confirm
from prettyprint import pp
import re
VERSION_PATTERN = r'^v\d+(\.\d+)+?$'
env.releases_directory = "release"
env.root_dir = os.path.abspath(os.path.dirname(__file__))
env.release = "HEAD"
proxy =... | true | true |
f74786b71dbd9c0ef132f042537770ffed54844c | 1,958 | py | Python | omd/versions/1.2.8p15.cre/share/check_mk/web/plugins/sidebar/bi.py | NCAR/spol-nagios | 4f88bef953983050bc6568d3f1027615fbe223fb | [
"BSD-3-Clause"
] | null | null | null | omd/versions/1.2.8p15.cre/share/check_mk/web/plugins/sidebar/bi.py | NCAR/spol-nagios | 4f88bef953983050bc6568d3f1027615fbe223fb | [
"BSD-3-Clause"
] | null | null | null | omd/versions/1.2.8p15.cre/share/check_mk/web/plugins/sidebar/bi.py | NCAR/spol-nagios | 4f88bef953983050bc6568d3f1027615fbe223fb | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
# | | | | '_ \ / _ \/ __| |/ /... | 46.619048 | 72 | 0.516854 |
import bi
def render_bi_groups():
html.write("<ul>")
for group in bi.aggregation_groups():
bulletlink(group, "view.py?view_name=aggr_group&aggr_group=%s" %
html.urlencode(group))
html.write("</ul>")
sidebar_snapins["biaggr_groups"] = {
"title" : _(... | true | true |
f74787ea25b558bb8b362b11e0bf289b5e0352c3 | 830 | py | Python | pyopteryx/factories/loop_action_factories/stop_action_factory.py | DanielZim/PyOpteryx | dd8fcdb23cc4ca52167820455a6d54c140f3cb00 | [
"MIT"
] | null | null | null | pyopteryx/factories/loop_action_factories/stop_action_factory.py | DanielZim/PyOpteryx | dd8fcdb23cc4ca52167820455a6d54c140f3cb00 | [
"MIT"
] | 2 | 2021-03-31T19:09:54.000Z | 2021-12-13T19:59:46.000Z | pyopteryx/factories/loop_action_factories/stop_action_factory.py | DanielZim/PyOpteryx | dd8fcdb23cc4ca52167820455a6d54c140f3cb00 | [
"MIT"
] | null | null | null | from pyopteryx.factories.loop_action_factories.abstract_loop_action_factory import AbstractLoopActionFactory
from pyopteryx.utils.builder_utils import add_activity_to_task, add_reply_entry
class StopLoopActionFactory(AbstractLoopActionFactory):
def __init__(self, action, xml_cache, input_data, processor, mapping_... | 51.875 | 108 | 0.719277 | from pyopteryx.factories.loop_action_factories.abstract_loop_action_factory import AbstractLoopActionFactory
from pyopteryx.utils.builder_utils import add_activity_to_task, add_reply_entry
class StopLoopActionFactory(AbstractLoopActionFactory):
def __init__(self, action, xml_cache, input_data, processor, mapping_... | true | true |
f74787f15a61331be3705ba76c93b2ad48f8e6e0 | 6,294 | py | Python | App/jobs/JobProduct.py | PhenomingZ/dicer2 | 3d50d3854a087eecaf45a744ddfe2fa2e225951a | [
"MIT"
] | 1 | 2020-12-20T12:00:43.000Z | 2020-12-20T12:00:43.000Z | App/jobs/JobProduct.py | PhenomingZ/dicer2 | 3d50d3854a087eecaf45a744ddfe2fa2e225951a | [
"MIT"
] | null | null | null | App/jobs/JobProduct.py | PhenomingZ/dicer2 | 3d50d3854a087eecaf45a744ddfe2fa2e225951a | [
"MIT"
] | null | null | null | import time
import traceback
from datetime import datetime
from App.controllers.BaseController import BaseController
from App.jobs import get_job_pool
from App.jobs.JobMultipleHandler import job_multiple_handler
from App.jobs.JobQueuePutter import JobSuccessQueuePutter, JobStartedQueuePutter, JobRunningQueuePutter, \... | 34.773481 | 110 | 0.614871 | import time
import traceback
from datetime import datetime
from App.controllers.BaseController import BaseController
from App.jobs import get_job_pool
from App.jobs.JobMultipleHandler import job_multiple_handler
from App.jobs.JobQueuePutter import JobSuccessQueuePutter, JobStartedQueuePutter, JobRunningQueuePutter, \... | true | true |
f7478a06b157a80edbc13339f0246fef45f682ad | 3,625 | py | Python | opsgenie_swagger/models/filter.py | Logicworks/opsgenie-python-sdk | 244c4c40ddcc25e70df5ba4425ab8d7c8da59c18 | [
"Apache-2.0"
] | null | null | null | opsgenie_swagger/models/filter.py | Logicworks/opsgenie-python-sdk | 244c4c40ddcc25e70df5ba4425ab8d7c8da59c18 | [
"Apache-2.0"
] | null | null | null | opsgenie_swagger/models/filter.py | Logicworks/opsgenie-python-sdk | 244c4c40ddcc25e70df5ba4425ab8d7c8da59c18 | [
"Apache-2.0"
] | 1 | 2020-11-07T11:27:13.000Z | 2020-11-07T11:27:13.000Z | # coding: utf-8
"""
OpsGenie REST API
OpsGenie OpenAPI Specification # noqa: E501
OpenAPI spec version: 2.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class Filter(object):
"""NOTE: This class is auto generate... | 27.671756 | 99 | 0.555034 |
import pprint
import re
import six
class Filter(object):
swagger_types = {
'type': 'str'
}
attribute_map = {
'type': 'type'
}
discriminator_value_class_map = {
'match-all': 'MatchAll',
'match-any-condition': 'MatchAnyCondition',
'match-all-conditio... | true | true |
f7478a99b38f092b7e4aa40582e2ed689b79d700 | 2,586 | py | Python | core/tests/test_streams/test_artifacts_endpoints.py | Ohtar10/polyaxon | 1e41804e4ae6466b6928d06bc6ee6d2d9c7b8931 | [
"Apache-2.0"
] | null | null | null | core/tests/test_streams/test_artifacts_endpoints.py | Ohtar10/polyaxon | 1e41804e4ae6466b6928d06bc6ee6d2d9c7b8931 | [
"Apache-2.0"
] | null | null | null | core/tests/test_streams/test_artifacts_endpoints.py | Ohtar10/polyaxon | 1e41804e4ae6466b6928d06bc6ee6d2d9c7b8931 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, 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 applicable ... | 39.181818 | 84 | 0.701083 |
import os
from polyaxon import settings
from polyaxon.streams.app.main import STREAMS_URL
from polyaxon.utils.path_utils import create_path
from tests.test_streams.base import create_tmp_files, get_streams_client, set_store
from tests.utils import BaseTestCase
class TestArtifactsEndpoints(BaseTestCase... | true | true |
f7478aab3e803a8f04dfed6bb5befd90cb9771b1 | 4,143 | py | Python | openalpr_api/models/vehicle_candidate.py | westofsun/Traffic-Rule-Violation-Detection-System | 47dbf9a7c926712e0e987404e74d5cc3cd79713b | [
"MIT"
] | 221 | 2018-04-25T00:02:30.000Z | 2022-03-30T18:46:23.000Z | openalpr_api/models/vehicle_candidate.py | westofsun/Traffic-Rule-Violation-Detection-System | 47dbf9a7c926712e0e987404e74d5cc3cd79713b | [
"MIT"
] | 39 | 2018-10-04T04:40:11.000Z | 2021-10-04T07:07:46.000Z | openalpr_api/models/vehicle_candidate.py | westofsun/Traffic-Rule-Violation-Detection-System | 47dbf9a7c926712e0e987404e74d5cc3cd79713b | [
"MIT"
] | 121 | 2018-04-25T00:02:33.000Z | 2022-03-27T10:14:20.000Z | # coding: utf-8
"""
OpenALPR Cloud API
No descripton provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 2.0.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
Licensed under the Apache License, Version 2.0 (the "Licen... | 27.256579 | 104 | 0.566498 |
from pprint import pformat
from six import iteritems
import re
class VehicleCandidate(object):
def __init__(self, name=None, confidence=None):
self.swagger_types = {
'name': 'str',
'confidence': 'float'
}
self.attribute_map = {
'name': 'name',
... | true | true |
f7478c5181b3a190881963fdda829d05ec5633ef | 801 | py | Python | traceplus/base.py | traceplusplus/traceplus-python | eb20bf8840fed4c789157cacf85eed6fa45a2f26 | [
"MIT"
] | null | null | null | traceplus/base.py | traceplusplus/traceplus-python | eb20bf8840fed4c789157cacf85eed6fa45a2f26 | [
"MIT"
] | null | null | null | traceplus/base.py | traceplusplus/traceplus-python | eb20bf8840fed4c789157cacf85eed6fa45a2f26 | [
"MIT"
] | null | null | null | from __future__ import print_function, unicode_literals
import logging
from traceplus.common.functional import LazyObjectProxy
__all__ = [
'Tracer',
'NoopTracer',
'tracer'
]
class Tracer(object):
"""The basic Trace++ client.
"""
logger = logging.getLogger('traceplus.tracer')
def __init_... | 18.204545 | 55 | 0.700375 | from __future__ import print_function, unicode_literals
import logging
from traceplus.common.functional import LazyObjectProxy
__all__ = [
'Tracer',
'NoopTracer',
'tracer'
]
class Tracer(object):
logger = logging.getLogger('traceplus.tracer')
def __init__(self, *args, **kwargs):
pass
... | true | true |
f7478cdcd532bdfe31276a35c5eab3a7039a9ebc | 4,191 | py | Python | swagger_client/models/get_alliances_names_200_ok.py | rseichter/bootini-star | a80258f01a05e4df38748b8cb47dfadabd42c20d | [
"MIT"
] | null | null | null | swagger_client/models/get_alliances_names_200_ok.py | rseichter/bootini-star | a80258f01a05e4df38748b8cb47dfadabd42c20d | [
"MIT"
] | null | null | null | swagger_client/models/get_alliances_names_200_ok.py | rseichter/bootini-star | a80258f01a05e4df38748b8cb47dfadabd42c20d | [
"MIT"
] | null | null | null | # coding: utf-8
"""
EVE Swagger Interface
An OpenAPI for EVE Online # noqa: E501
OpenAPI spec version: 0.8.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class GetAlliancesNames200Ok(object):
"""NOTE: This class i... | 28.903448 | 99 | 0.591983 |
import pprint
import re
import six
class GetAlliancesNames200Ok(object):
swagger_types = {
'alliance_id': 'int',
'alliance_name': 'str'
}
attribute_map = {
'alliance_id': 'alliance_id',
'alliance_name': 'alliance_name'
}
def __init__(self, alliance_id=None... | true | true |
f7478decb3ab989f1b13f21eb949d75d4647e221 | 4,415 | py | Python | src/others/utils.py | ithieund/PreSumModified | f661e2b7b04cfd8f2d279d61eeacd1eb74f64f24 | [
"MIT"
] | null | null | null | src/others/utils.py | ithieund/PreSumModified | f661e2b7b04cfd8f2d279d61eeacd1eb74f64f24 | [
"MIT"
] | null | null | null | src/others/utils.py | ithieund/PreSumModified | f661e2b7b04cfd8f2d279d61eeacd1eb74f64f24 | [
"MIT"
] | null | null | null | import os
import re
import shutil
import time
from others import pyrouge
REMAP = {"-lrb-": "(", "-rrb-": ")", "-lcb-": "{", "-rcb-": "}",
"-lsb-": "[", "-rsb-": "]", "``": '"', "''": '"'}
def clean(x):
return re.sub(
r"-lrb-|-rrb-|-lcb-|-rcb-|-lsb-|-rsb-|``|''",
lambda m: REMAP.get(m.gr... | 34.492188 | 104 | 0.562627 | import os
import re
import shutil
import time
from others import pyrouge
REMAP = {"-lrb-": "(", "-rrb-": ")", "-lcb-": "{", "-rcb-": "}",
"-lsb-": "[", "-rsb-": "]", "``": '"', "''": '"'}
def clean(x):
return re.sub(
r"-lrb-|-rrb-|-lcb-|-rcb-|-lsb-|-rsb-|``|''",
lambda m: REMAP.get(m.gr... | true | true |
f7478ef32c9c72b8a828cc02b5f9dd48ecdad231 | 2,945 | py | Python | bin/calc_graphdna.py | hasibaasma/alfpy | c8c0c1300108015746320cede2207ac57e630d3e | [
"MIT"
] | 19 | 2017-02-20T17:42:02.000Z | 2021-12-16T19:07:17.000Z | bin/calc_graphdna.py | eggleader/alfpy | e0782e9551458ef17ab29df8af13fc0f8925e894 | [
"MIT"
] | 3 | 2018-03-12T23:54:27.000Z | 2020-12-09T21:53:19.000Z | bin/calc_graphdna.py | eggleader/alfpy | e0782e9551458ef17ab29df8af13fc0f8925e894 | [
"MIT"
] | 6 | 2016-12-06T09:12:04.000Z | 2021-09-24T14:40:47.000Z | #! /usr/bin/env python
# Copyright (c) 2016 Zielezinski A, combio.pl
import argparse
import sys
from alfpy import graphdna
from alfpy.utils import distmatrix
from alfpy.utils import seqrecords
from alfpy.version import __version__
def get_parser():
parser = argparse.ArgumentParser(
description='''Calcu... | 34.244186 | 79 | 0.621053 |
import argparse
import sys
from alfpy import graphdna
from alfpy.utils import distmatrix
from alfpy.utils import seqrecords
from alfpy.version import __version__
def get_parser():
parser = argparse.ArgumentParser(
description='''Calculate distance between DNA sequences based on
the two-dimens... | true | true |
f7478f94cf0c8889ef90c08e548d89f37f14e481 | 4,786 | py | Python | python2/koans/about_classes.py | nitinnain/python_koans | 271e291911d2d42a1afdace69048374527089a6e | [
"MIT"
] | 1 | 2017-09-01T20:51:57.000Z | 2017-09-01T20:51:57.000Z | python2/koans/about_classes.py | nitinnain/python_koans | 271e291911d2d42a1afdace69048374527089a6e | [
"MIT"
] | null | null | null | python2/koans/about_classes.py | nitinnain/python_koans | 271e291911d2d42a1afdace69048374527089a6e | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutClasses(Koan):
class Dog(object):
"Dogs need regular walkies. Never, ever let them drive."
def test_instances_of_classes_can_be_created_adding_parentheses(self):
fido = self.Dog()
self.assertEqual(Abou... | 30.291139 | 79 | 0.578771 |
from runner.koan import *
class AboutClasses(Koan):
class Dog(object):
def test_instances_of_classes_can_be_created_adding_parentheses(self):
fido = self.Dog()
self.assertEqual(AboutClasses.Dog, fido.__class__)
def test_classes_have_docstrings(self):
self.assertMatch('Dogs', s... | true | true |
f7479018db9b66fc7c858f3b5630f1b963f5f603 | 416 | py | Python | myp/scripts/funcs.py | YunisDEV/py-scripts | c9eccffa3e69bb32a46fef94e0517a149f3701ea | [
"MIT"
] | 2 | 2021-04-03T14:16:16.000Z | 2021-04-03T15:38:32.000Z | myp/scripts/funcs.py | YunisDEV/py-scripts | c9eccffa3e69bb32a46fef94e0517a149f3701ea | [
"MIT"
] | null | null | null | myp/scripts/funcs.py | YunisDEV/py-scripts | c9eccffa3e69bb32a46fef94e0517a149f3701ea | [
"MIT"
] | 2 | 2021-04-15T10:28:28.000Z | 2021-04-28T19:22:16.000Z | from ..package import MYPReader
def addScript(name: str, command: str, description: str = ""):
myp = MYPReader()
myp.add_script(
name=name,
command=command,
description=description,
)
myp.write()
print('Script added successfully.')
def removeScript(name: str):
myp = MY... | 21.894737 | 62 | 0.639423 | from ..package import MYPReader
def addScript(name: str, command: str, description: str = ""):
myp = MYPReader()
myp.add_script(
name=name,
command=command,
description=description,
)
myp.write()
print('Script added successfully.')
def removeScript(name: str):
myp = MY... | true | true |
f747908f394527767f742247f53f02121243cac2 | 14,082 | py | Python | fairseq/options.py | JustCunn/fairseq | ed74f553041c1b453603bfb20a36558d3e984e89 | [
"MIT"
] | null | null | null | fairseq/options.py | JustCunn/fairseq | ed74f553041c1b453603bfb20a36558d3e984e89 | [
"MIT"
] | null | null | null | fairseq/options.py | JustCunn/fairseq | ed74f553041c1b453603bfb20a36558d3e984e89 | [
"MIT"
] | null | null | null | # 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 argparse
from typing import Callable, List, Optional
import torch
from fairseq import utils
from fairseq.data.indexed_dataset import g... | 38.059459 | 88 | 0.680443 |
import argparse
from typing import Callable, List, Optional
import torch
from fairseq import utils
from fairseq.data.indexed_dataset import get_available_dataset_impl
from fairseq.dataclass.configs import (
CheckpointConfig,
CommonConfig,
CommonEvalConfig,
DatasetConfig,
DistributedTrainingCon... | true | true |
f74791365421e4998aebdc28a233685654c86c40 | 9,410 | py | Python | ce-host/4.4.0/download_apps.py | GluuFederation/community-edition-build | 3254104b0c78c42994f023e9021e67e59782e079 | [
"MIT"
] | null | null | null | ce-host/4.4.0/download_apps.py | GluuFederation/community-edition-build | 3254104b0c78c42994f023e9021e67e59782e079 | [
"MIT"
] | null | null | null | ce-host/4.4.0/download_apps.py | GluuFederation/community-edition-build | 3254104b0c78c42994f023e9021e67e59782e079 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import os
import sys
import json
import zipfile
import shutil
from urllib.request import urlretrieve
cur_dir = os.path.dirname(os.path.realpath(__file__))
app_dir = os.path.join(cur_dir, 'opt/dist/app')
gluu_app_dir = os.path.join(cur_dir, 'opt/dist/gluu')
target = 'el7'
if '-el8' in sys.argv:
... | 65.804196 | 254 | 0.700956 |
import os
import sys
import json
import zipfile
import shutil
from urllib.request import urlretrieve
cur_dir = os.path.dirname(os.path.realpath(__file__))
app_dir = os.path.join(cur_dir, 'opt/dist/app')
gluu_app_dir = os.path.join(cur_dir, 'opt/dist/gluu')
target = 'el7'
if '-el8' in sys.argv:
target = 'el8'
e... | true | true |
f74791dee96b2b58cbf62de16d4f52044d96fcf3 | 2,121 | py | Python | examples/workbench/persistent_workspace.py | xtuzy/enaml | a1b5c0df71c665b6ef7f61d21260db92d77d9a46 | [
"BSD-3-Clause-Clear"
] | 1,080 | 2015-01-04T14:29:34.000Z | 2022-03-29T05:44:51.000Z | examples/workbench/persistent_workspace.py | xtuzy/enaml | a1b5c0df71c665b6ef7f61d21260db92d77d9a46 | [
"BSD-3-Clause-Clear"
] | 308 | 2015-01-05T22:44:13.000Z | 2022-03-30T21:19:18.000Z | examples/workbench/persistent_workspace.py | xtuzy/enaml | a1b5c0df71c665b6ef7f61d21260db92d77d9a46 | [
"BSD-3-Clause-Clear"
] | 123 | 2015-01-25T16:33:48.000Z | 2022-02-25T19:57:10.000Z | #------------------------------------------------------------------------------
# Copyright (c) 2013, Nucleic Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
#-----------------------------------------------------... | 27.545455 | 79 | 0.623762 |
from __future__ import print_function
import pickle
from atom.api import Str
from enaml.widgets.api import Container
from enaml.workbench.ui.api import Workspace
import enaml
with enaml.imports():
from persistent_view import PersistentManifest, create_new_area
print('Imported Persistent Workspace!')
... | true | true |
f747923b2ff37ac666d143a133db0d97c3ec5935 | 277 | py | Python | Libraries/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib-1.4.3-py2.7-macosx-10.5-intel.egg/matplotlib/ft2font.py | mlewis1973/pyosirix | 77757744f250ea1e3be083f50dce70f7aa094c5d | [
"BSD-3-Clause"
] | 20 | 2016-02-02T10:31:41.000Z | 2021-11-08T08:35:25.000Z | Libraries/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib-1.4.3-py2.7-macosx-10.5-intel.egg/matplotlib/ft2font.py | mlewis1973/pyosirix | 77757744f250ea1e3be083f50dce70f7aa094c5d | [
"BSD-3-Clause"
] | 7 | 2016-10-21T04:15:22.000Z | 2020-02-15T04:06:19.000Z | Libraries/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib-1.4.3-py2.7-macosx-10.5-intel.egg/matplotlib/ft2font.py | mlewis1973/pyosirix | 77757744f250ea1e3be083f50dce70f7aa094c5d | [
"BSD-3-Clause"
] | 9 | 2018-01-24T21:46:10.000Z | 2022-03-08T09:42:42.000Z | def __bootstrap__():
global __bootstrap__, __loader__, __file__
import sys, pkg_resources, imp
__file__ = pkg_resources.resource_filename(__name__,'ft2font.so')
__loader__ = None; del __bootstrap__, __loader__
imp.load_dynamic(__name__,__file__)
__bootstrap__()
| 34.625 | 68 | 0.783394 | def __bootstrap__():
global __bootstrap__, __loader__, __file__
import sys, pkg_resources, imp
__file__ = pkg_resources.resource_filename(__name__,'ft2font.so')
__loader__ = None; del __bootstrap__, __loader__
imp.load_dynamic(__name__,__file__)
__bootstrap__()
| true | true |
f74792be1e23962965f628b6e167020dda6c1633 | 7,018 | py | Python | src/demo-question-gen.py | chris4540/StudyMaskedLMForQG | 2bf477b7b8cfb5d195c028db6d63aadf06af8fc5 | [
"MIT"
] | 6 | 2020-12-09T11:30:37.000Z | 2022-03-03T12:06:44.000Z | src/demo-question-gen.py | chris4540/StudyMaskedLMForQG | 2bf477b7b8cfb5d195c028db6d63aadf06af8fc5 | [
"MIT"
] | null | null | null | src/demo-question-gen.py | chris4540/StudyMaskedLMForQG | 2bf477b7b8cfb5d195c028db6d63aadf06af8fc5 | [
"MIT"
] | 3 | 2021-03-23T04:56:48.000Z | 2022-02-02T19:31:46.000Z | """
This script is to generate
"""
import os
import torch
from pathlib import Path
from dataclasses import dataclass
from utils import save_as_json
from utils.logging import logging
from models.tokenizer import BertTokenizerWithHLAns
from utils.data.datasets.squad import QnGenHLCtxtDataset
from utils.eval import clean_... | 33.419048 | 129 | 0.603163 | import os
import torch
from pathlib import Path
from dataclasses import dataclass
from utils import save_as_json
from utils.logging import logging
from models.tokenizer import BertTokenizerWithHLAns
from utils.data.datasets.squad import QnGenHLCtxtDataset
from utils.eval import clean_hypothesis
from utils.logging impor... | true | true |
f74792d2a177aa7e4fe363a467a4c6f3e452c4b4 | 1,501 | py | Python | api/urls.py | qinyanjuidavid/Dhana | 5a97ab224897bb87ce69d476a88930f3012ae7c5 | [
"MIT"
] | null | null | null | api/urls.py | qinyanjuidavid/Dhana | 5a97ab224897bb87ce69d476a88930f3012ae7c5 | [
"MIT"
] | null | null | null | api/urls.py | qinyanjuidavid/Dhana | 5a97ab224897bb87ce69d476a88930f3012ae7c5 | [
"MIT"
] | 1 | 2022-02-14T19:11:08.000Z | 2022-02-14T19:11:08.000Z | from django.urls import path
from accounts.views.api_views import (LoginViewSet,
CustomerRegistrationViewSet,
RefreshViewSet, VerifyEmail,
RequestPasswordResetEmail,
Pa... | 38.487179 | 73 | 0.596269 | from django.urls import path
from accounts.views.api_views import (LoginViewSet,
CustomerRegistrationViewSet,
RefreshViewSet, VerifyEmail,
RequestPasswordResetEmail,
Pa... | true | true |
f74793ccfaaff9fb8636b1e21cf893f6952f3e68 | 4,423 | py | Python | Cognitive-Code/Cognitive-Face-Python/sample/view/panel_group.py | PacktPublishing/Smarter-Web-Apps-with-Azure-ML-and-Cognitive-Services | eddf766e6527fd5f4dc55b0ff94253554e906aca | [
"MIT"
] | 1 | 2019-10-30T13:31:12.000Z | 2019-10-30T13:31:12.000Z | Cognitive-Code/Cognitive-Face-Python/sample/view/panel_group.py | PacktPublishing/Smarter-Web-Apps-with-Azure-ML-and-Cognitive-Services | eddf766e6527fd5f4dc55b0ff94253554e906aca | [
"MIT"
] | null | null | null | Cognitive-Code/Cognitive-Face-Python/sample/view/panel_group.py | PacktPublishing/Smarter-Web-Apps-with-Azure-ML-and-Cognitive-Services | eddf766e6527fd5f4dc55b0ff94253554e906aca | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
File: panel_group.py
Description: Group Panel for Python SDK sample.
"""
import os
import wx
import wx.lib.scrolledpanel as scrolled
import util
import model
from view import base
class GroupPanel(base.MyPanel):
"""Group Panel."""
def _... | 33.507576 | 80 | 0.562062 |
import os
import wx
import wx.lib.scrolledpanel as scrolled
import util
import model
from view import base
class GroupPanel(base.MyPanel):
def __init__(self, parent):
super(GroupPanel, self).__init__(parent)
self.face_paths = []
self.faces = {}
self.vsize... | true | true |
f74795354f53f05ecf0fdb70180fca9f5cf71dd1 | 2,111 | py | Python | get_stats.py | ctsit/HCV_Target_reports | 971ab5883dd44d136e7c818076fdaa553f30746b | [
"Apache-2.0"
] | null | null | null | get_stats.py | ctsit/HCV_Target_reports | 971ab5883dd44d136e7c818076fdaa553f30746b | [
"Apache-2.0"
] | null | null | null | get_stats.py | ctsit/HCV_Target_reports | 971ab5883dd44d136e7c818076fdaa553f30746b | [
"Apache-2.0"
] | null | null | null | import json
from copy import copy
from stat_utils import *
with open('time_trimmed.json', 'r') as infile:
data = json.loads(infile.read())
subject_stats = {}
inr_fields = [
'inr_im_lborres',
]
chem_fields = [
'alt_im_lborres',
'ast_im_lborres',
'dbil_im_lborres',
'tbil_im_lborres',
]
inr_dat... | 36.396552 | 100 | 0.637139 | import json
from copy import copy
from stat_utils import *
with open('time_trimmed.json', 'r') as infile:
data = json.loads(infile.read())
subject_stats = {}
inr_fields = [
'inr_im_lborres',
]
chem_fields = [
'alt_im_lborres',
'ast_im_lborres',
'dbil_im_lborres',
'tbil_im_lborres',
]
inr_dat... | true | true |
f747962537642081b1e1264a180e5441e805a5f3 | 4,587 | bzl | Python | scala/private/rules/scala_junit_test.bzl | justinass-wix/rules_scala | 4ba3780fcba8d26980daff4639abc6f18517308b | [
"Apache-2.0"
] | null | null | null | scala/private/rules/scala_junit_test.bzl | justinass-wix/rules_scala | 4ba3780fcba8d26980daff4639abc6f18517308b | [
"Apache-2.0"
] | null | null | null | scala/private/rules/scala_junit_test.bzl | justinass-wix/rules_scala | 4ba3780fcba8d26980daff4639abc6f18517308b | [
"Apache-2.0"
] | null | null | null | """Rules for writing tests with JUnit"""
load("@bazel_skylib//lib:dicts.bzl", _dicts = "dicts")
load(
"@io_bazel_rules_scala//scala/private:common_attributes.bzl",
"common_attrs",
"implicit_deps",
"launcher_template",
)
load("@io_bazel_rules_scala//scala/private:common_outputs.bzl", "common_outputs")
l... | 32.764286 | 117 | 0.649226 |
load("@bazel_skylib//lib:dicts.bzl", _dicts = "dicts")
load(
"@io_bazel_rules_scala//scala/private:common_attributes.bzl",
"common_attrs",
"implicit_deps",
"launcher_template",
)
load("@io_bazel_rules_scala//scala/private:common_outputs.bzl", "common_outputs")
load(
"@io_bazel_rules_scala//scala/pr... | true | true |
f747967f1e57469dda9646f7724de30cd7b34d4d | 190 | py | Python | selectable/tests/views.py | zeehio/django-selectable | 40c44559320a98229091b56c034e145eb77e24af | [
"BSD-2-Clause"
] | null | null | null | selectable/tests/views.py | zeehio/django-selectable | 40c44559320a98229091b56c034e145eb77e24af | [
"BSD-2-Clause"
] | null | null | null | selectable/tests/views.py | zeehio/django-selectable | 40c44559320a98229091b56c034e145eb77e24af | [
"BSD-2-Clause"
] | 1 | 2020-01-08T09:08:21.000Z | 2020-01-08T09:08:21.000Z | from django.http import HttpResponseNotFound, HttpResponseServerError
def test_404(request):
return HttpResponseNotFound()
def test_500(request):
return HttpResponseServerError()
| 21.111111 | 69 | 0.810526 | from django.http import HttpResponseNotFound, HttpResponseServerError
def test_404(request):
return HttpResponseNotFound()
def test_500(request):
return HttpResponseServerError()
| true | true |
f74796ba3553291863fd3571b824b19bdea6374e | 4,614 | py | Python | heat/openstack/common/loopingcall.py | NeCTAR-RC/heat | b152817f192a7b46514793633ddc968c1fe1ebf8 | [
"Apache-2.0"
] | 1 | 2015-02-26T03:23:23.000Z | 2015-02-26T03:23:23.000Z | heat/openstack/common/loopingcall.py | NeCTAR-RC/heat | b152817f192a7b46514793633ddc968c1fe1ebf8 | [
"Apache-2.0"
] | null | null | null | heat/openstack/common/loopingcall.py | NeCTAR-RC/heat | b152817f192a7b46514793633ddc968c1fe1ebf8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance wi... | 31.60274 | 78 | 0.596446 |
import sys
from eventlet import event
from eventlet import greenthread
from heat.openstack.common.gettextutils import _
from heat.openstack.common import log as logging
from heat.openstack.common import timeutils
LOG = logging.getLogger(__name__)
class LoopingCallDone(Exception):
def __init__... | true | true |
f74796e8e99bbf614222fa8ec6db5b66a8c564ba | 1,810 | py | Python | comparison/without/buttons.py | cheery/elm-bonsai | 22fe5f731bf2b3d711c15e4aa6316eefde4754e0 | [
"BSD-3-Clause"
] | null | null | null | comparison/without/buttons.py | cheery/elm-bonsai | 22fe5f731bf2b3d711c15e4aa6316eefde4754e0 | [
"BSD-3-Clause"
] | null | null | null | comparison/without/buttons.py | cheery/elm-bonsai | 22fe5f731bf2b3d711c15e4aa6316eefde4754e0 | [
"BSD-3-Clause"
] | null | null | null | import pygame, time, sys
class VirtualButton(object):
def __init__(self, key, x, y):
self.key = key
self.down = False
self.x = x
self.y = y
left = VirtualButton(pygame.K_LEFT, 0, 1)
up = VirtualButton(pygame.K_UP, 1, 0)
right = VirtualButton(pygame.K_RIGHT, 2, 1)
down = VirtualButt... | 24.794521 | 74 | 0.553039 | import pygame, time, sys
class VirtualButton(object):
def __init__(self, key, x, y):
self.key = key
self.down = False
self.x = x
self.y = y
left = VirtualButton(pygame.K_LEFT, 0, 1)
up = VirtualButton(pygame.K_UP, 1, 0)
right = VirtualButton(pygame.K_RIGHT, 2, 1)
down = VirtualButt... | true | true |
f747977ad041e44d2ca3058c7a889ea0a8da1bb2 | 37 | py | Python | IPC/Servers/__init__.py | Seniatical/IPC | 145461a932974cb1e2125a134bcda0d12a54dae3 | [
"MIT"
] | null | null | null | IPC/Servers/__init__.py | Seniatical/IPC | 145461a932974cb1e2125a134bcda0d12a54dae3 | [
"MIT"
] | null | null | null | IPC/Servers/__init__.py | Seniatical/IPC | 145461a932974cb1e2125a134bcda0d12a54dae3 | [
"MIT"
] | null | null | null | from . import (
Async, Sync
)
| 9.25 | 16 | 0.513514 | from . import (
Async, Sync
)
| true | true |
f74797a94aef29b7dc515687b9016fd59decbd26 | 14,911 | py | Python | test_cyclegan.py | hsuRush/CC-CycleGAN | 99646b3bae3bb014ee4b19330531b885a1bfddc1 | [
"MIT"
] | null | null | null | test_cyclegan.py | hsuRush/CC-CycleGAN | 99646b3bae3bb014ee4b19330531b885a1bfddc1 | [
"MIT"
] | null | null | null | test_cyclegan.py | hsuRush/CC-CycleGAN | 99646b3bae3bb014ee4b19330531b885a1bfddc1 | [
"MIT"
] | null | null | null | from __future__ import print_function, division
import scipy
from keras.datasets import mnist
from instanceNormalization import InstanceNormalization
from keras.layers import Input, Dense, Reshape, Flatten, Dropout, Concatenate, GRU, CuDNNGRU, Bidirectional, Lambda
from keras.layers import BatchNormalization, Activati... | 41.534819 | 186 | 0.609684 | from __future__ import print_function, division
import scipy
from keras.datasets import mnist
from instanceNormalization import InstanceNormalization
from keras.layers import Input, Dense, Reshape, Flatten, Dropout, Concatenate, GRU, CuDNNGRU, Bidirectional, Lambda
from keras.layers import BatchNormalization, Activati... | true | true |
f74798fffdbb99b5d1e2462eefa184c2e70a558b | 11,589 | py | Python | python/ray/rllib/agents/impala/vtrace_test.py | BnJam/ray | c32658ff7550f8672923ca6d824d85c5efd82a5b | [
"Apache-2.0"
] | 3 | 2018-06-06T22:36:49.000Z | 2018-06-06T22:41:55.000Z | python/ray/rllib/agents/impala/vtrace_test.py | BnJam/ray | c32658ff7550f8672923ca6d824d85c5efd82a5b | [
"Apache-2.0"
] | 2 | 2019-01-28T00:31:25.000Z | 2019-11-26T16:57:06.000Z | python/ray/rllib/agents/impala/vtrace_test.py | BnJam/ray | c32658ff7550f8672923ca6d824d85c5efd82a5b | [
"Apache-2.0"
] | 2 | 2020-03-26T16:32:08.000Z | 2021-02-05T17:04:11.000Z | # Copyright 2018 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, ... | 43.081784 | 79 | 0.622918 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl.testing import parameterized
import numpy as np
import tensorflow as tf
import vtrace
def _shaped_arange(*shape):
return np.arange(np.prod(shape), dtype=np.float32).reshape(*shape)... | true | true |
f747998c74b5ab9e185d7dc6b9a2e6d002f2387c | 1,950 | py | Python | yardstick/benchmark/scenarios/cmri/openlab/router_add_interface.py | mythwm/yardstick-wm | 319ced11df92456b42c80cfd6e53c66dbd22a746 | [
"Apache-2.0"
] | 1 | 2019-12-08T21:57:31.000Z | 2019-12-08T21:57:31.000Z | yardstick/benchmark/scenarios/cmri/openlab/router_add_interface.py | mythwm/yardstick-wm | 319ced11df92456b42c80cfd6e53c66dbd22a746 | [
"Apache-2.0"
] | null | null | null | yardstick/benchmark/scenarios/cmri/openlab/router_add_interface.py | mythwm/yardstick-wm | 319ced11df92456b42c80cfd6e53c66dbd22a746 | [
"Apache-2.0"
] | null | null | null | ##############################################################################
# Copyright (c) 2017 Huawei Technologies Co.,Ltd and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, ... | 33.050847 | 78 | 0.607179 | true | true | |
f7479a2c5aaa7806b90c8dc48cc52fc586bbfd1a | 6,546 | py | Python | pdf4me/Pdf4mePythonClientApi/pdf4me/model/protect_action.py | pdf4me/pdf4me-clientapi-python | 17a1c1baae861369084d658475be56be42ca92d0 | [
"MIT"
] | 1 | 2020-06-30T22:18:17.000Z | 2020-06-30T22:18:17.000Z | pdf4me/Pdf4mePythonClientApi/pdf4me/model/protect_action.py | pdf4me/pdf4me-clientapi-python | 17a1c1baae861369084d658475be56be42ca92d0 | [
"MIT"
] | null | null | null | pdf4me/Pdf4mePythonClientApi/pdf4me/model/protect_action.py | pdf4me/pdf4me-clientapi-python | 17a1c1baae861369084d658475be56be42ca92d0 | [
"MIT"
] | 1 | 2018-07-10T17:40:37.000Z | 2018-07-10T17:40:37.000Z | # coding: utf-8
"""
Pdf4me
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: v1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class... | 28.837004 | 157 | 0.582799 |
import pprint
import re
import six
class ProtectAction(object):
swagger_types = {
'user_password': 'str',
'owner_password': 'str',
'unlock': 'bool',
'permissions': 'list[str]',
'action_id': 'str'
}
attribute_map = {
'user_password': 'userPassword',
... | true | true |
f7479a8edc59b66f47e1e9e7e598ec5457983053 | 16,697 | py | Python | livestyled/models/product.py | Edvinas9/python-sdk | e24413b337f7d2232e28944b93ded7a430df0293 | [
"MIT"
] | null | null | null | livestyled/models/product.py | Edvinas9/python-sdk | e24413b337f7d2232e28944b93ded7a430df0293 | [
"MIT"
] | 1 | 2020-05-21T10:01:07.000Z | 2020-05-21T10:01:07.000Z | livestyled/models/product.py | livestyled/python-sdk | e75263e8bbf7132e4ce0e69d0ca3ad19088661b2 | [
"MIT"
] | 3 | 2021-02-01T10:13:36.000Z | 2022-02-11T17:47:30.000Z | from typing import List
from livestyled.models.fulfilment_point import FulfilmentPoint
class ProductVariant:
def __init__(
self,
id,
price,
stocks,
external_id,
translations,
product,
tax=None,
tax_rate=No... | 30.52468 | 112 | 0.547883 | from typing import List
from livestyled.models.fulfilment_point import FulfilmentPoint
class ProductVariant:
def __init__(
self,
id,
price,
stocks,
external_id,
translations,
product,
tax=None,
tax_rate=No... | true | true |
f7479b3e9fb52398e0f6ad625114aaf2a9307de0 | 1,867 | py | Python | utils/bot.py | davisschenk/Unnamed-Bot | 8e05d5a79dfab768574efd4e9061e2d7b22ae9e5 | [
"MIT"
] | null | null | null | utils/bot.py | davisschenk/Unnamed-Bot | 8e05d5a79dfab768574efd4e9061e2d7b22ae9e5 | [
"MIT"
] | null | null | null | utils/bot.py | davisschenk/Unnamed-Bot | 8e05d5a79dfab768574efd4e9061e2d7b22ae9e5 | [
"MIT"
] | null | null | null | from discord.ext import commands
import discord
import sys
from pathlib import Path
import motor.motor_asyncio
from config import token, extension_dir
from utils.context import UnnamedContext
from utils.help import PaginatedHelpCommand
class UnnamedBot(commands.Bot):
def __init__(self, command_prefix, **options):... | 34.574074 | 83 | 0.626674 | from discord.ext import commands
import discord
import sys
from pathlib import Path
import motor.motor_asyncio
from config import token, extension_dir
from utils.context import UnnamedContext
from utils.help import PaginatedHelpCommand
class UnnamedBot(commands.Bot):
def __init__(self, command_prefix, **options):... | true | true |
f7479bc755c5493c55979e8e4e49714f22116282 | 6,587 | py | Python | retro/examples/brute.py | MatPoliquin/retro | c70c174a9818d1e97bc36e61abb4694d28fc68e1 | [
"MIT-0",
"MIT"
] | 2,706 | 2018-04-05T18:28:50.000Z | 2022-03-29T16:56:59.000Z | retro/examples/brute.py | MatPoliquin/retro | c70c174a9818d1e97bc36e61abb4694d28fc68e1 | [
"MIT-0",
"MIT"
] | 242 | 2018-04-05T22:30:42.000Z | 2022-03-19T01:55:11.000Z | retro/examples/brute.py | MatPoliquin/retro | c70c174a9818d1e97bc36e61abb4694d28fc68e1 | [
"MIT-0",
"MIT"
] | 464 | 2018-04-05T19:10:34.000Z | 2022-03-28T13:33:32.000Z | """
Implementation of the Brute from "Revisiting the Arcade Learning Environment:
Evaluation Protocols and Open Problems for General Agents" by Machado et al.
https://arxiv.org/abs/1709.06009
This is an agent that uses the determinism of the environment in order to do
pretty well at a number of retro games. It does n... | 28.764192 | 109 | 0.609838 |
import random
import argparse
import numpy as np
import retro
import gym
EXPLORATION_PARAM = 0.005
class Frameskip(gym.Wrapper):
def __init__(self, env, skip=4):
super().__init__(env)
self._skip = skip
def reset(self):
return self.env.reset()
def step(self, act):
tota... | true | true |
f7479c731f41f66c69005d15cdc90cdfeb1005f0 | 2,007 | py | Python | test/test_adapter_port_channel_settings_ref.py | sdnit-se/intersight-python | 551f7685c0f76bb8af60ec83ffb6f9672d49a4ae | [
"Apache-2.0"
] | 21 | 2018-03-29T14:20:35.000Z | 2021-10-13T05:11:41.000Z | test/test_adapter_port_channel_settings_ref.py | sdnit-se/intersight-python | 551f7685c0f76bb8af60ec83ffb6f9672d49a4ae | [
"Apache-2.0"
] | 14 | 2018-01-30T15:45:46.000Z | 2022-02-23T14:23:21.000Z | test/test_adapter_port_channel_settings_ref.py | sdnit-se/intersight-python | 551f7685c0f76bb8af60ec83ffb6f9672d49a4ae | [
"Apache-2.0"
] | 18 | 2018-01-03T15:09:56.000Z | 2021-07-16T02:21:54.000Z | # coding: utf-8
"""
Cisco Intersight
Cisco Intersight is a management platform delivered as a service with embedded analytics for your Cisco and 3rd party IT infrastructure. This platform offers an intelligent level of management that enables IT organizations to analyze, simplify, and automate their environmen... | 52.815789 | 1,052 | 0.790234 |
from __future__ import absolute_import
import unittest
import intersight
from intersight.models.adapter_port_channel_settings_ref import AdapterPortChannelSettingsRef
from intersight.rest import ApiException
class TestAdapterPortChannelSettingsRef(unittest.TestCase):
def setUp(self):
pass
def t... | true | true |
f7479ca1fa7f09e8b4efb22fabc1182c04b1cf52 | 8,557 | py | Python | fanbeams.py | ewanbarr/UtmostFanbeamMapper | e20721c4b21fd94977eb48503b81a784a8666045 | [
"Apache-2.0"
] | null | null | null | fanbeams.py | ewanbarr/UtmostFanbeamMapper | e20721c4b21fd94977eb48503b81a784a8666045 | [
"Apache-2.0"
] | null | null | null | fanbeams.py | ewanbarr/UtmostFanbeamMapper | e20721c4b21fd94977eb48503b81a784a8666045 | [
"Apache-2.0"
] | null | null | null | from astropy.io import fits
from coords import nsew_of_constant_dec,Molonglo,hadec_to_nsew
from scipy.ndimage import filters
import ephem as e
import numpy as np
import copy
SEC_TO_SID = 0.9972685185185185 # convert seconds to siderial "seconds"
EW_R = np.radians(2.0) # EW beam HWHM
NS_R = np.radians(1.0) # NS beam HW... | 32.911538 | 85 | 0.630595 | from astropy.io import fits
from coords import nsew_of_constant_dec,Molonglo,hadec_to_nsew
from scipy.ndimage import filters
import ephem as e
import numpy as np
import copy
SEC_TO_SID = 0.9972685185185185
EW_R = np.radians(2.0)
NS_R = np.radians(1.0)
class FanBeamTimeMap(object):
def __init__(self,data,lsts):... | true | true |
f7479d3ff69d52dff8870c93039f17582d44299f | 987 | py | Python | code/haha.py | Siemingfong/FilmFeatureCrawler | 98ab581ca8d9df70452ff28a8d061dc658461459 | [
"MIT"
] | null | null | null | code/haha.py | Siemingfong/FilmFeatureCrawler | 98ab581ca8d9df70452ff28a8d061dc658461459 | [
"MIT"
] | null | null | null | code/haha.py | Siemingfong/FilmFeatureCrawler | 98ab581ca8d9df70452ff28a8d061dc658461459 | [
"MIT"
] | null | null | null | import time
import random
import datetime
from bs4 import BeautifulSoup as bs
import pandas as pd
import os
import json
import requests
month=['01','02','03','04','05','06','07','08','09','10','11','12']
year=['2015','2016','2017','2018','2019','2020']
date=[]
movies=[]
def craw(startdate,enddate):
... | 24.073171 | 102 | 0.577508 | import time
import random
import datetime
from bs4 import BeautifulSoup as bs
import pandas as pd
import os
import json
import requests
month=['01','02','03','04','05','06','07','08','09','10','11','12']
year=['2015','2016','2017','2018','2019','2020']
date=[]
movies=[]
def craw(startdate,enddate):
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.