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 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f70c783d327d05400be9c870d3de601d76a9901d | 3,408 | py | Python | src/capsulesEM_V1/capsules/nets.py | LeanderLXZ/oracle-recognition | c82976333d4a72218b06fffc94192238d95fcf9e | [
"Apache-2.0"
] | 1 | 2022-02-08T09:33:16.000Z | 2022-02-08T09:33:16.000Z | src/capsulesEM_V1/capsules/nets.py | LeanderLXZ/oracle-recognition | c82976333d4a72218b06fffc94192238d95fcf9e | [
"Apache-2.0"
] | null | null | null | src/capsulesEM_V1/capsules/nets.py | LeanderLXZ/oracle-recognition | c82976333d4a72218b06fffc94192238d95fcf9e | [
"Apache-2.0"
] | null | null | null | """An implementation of matrix capsules with EM routing.
"""
import tensorflow as tf
from core import _conv2d_wrapper, capsules_init, capsules_conv, capsules_fc
slim = tf.contrib.slim
# ------------------------------------------------------------------------------#
# -------------------------------- capsules net --... | 33.742574 | 135 | 0.54196 |
import tensorflow as tf
from core import _conv2d_wrapper, capsules_init, capsules_conv, capsules_fc
slim = tf.contrib.slim
def capsules_v0(inputs, num_classes, iterations, name='CapsuleEM-V0'):
with tf.variable_scope(name) as scope:
nets = _conv2d_wrapper(
inputs, shape=[5, 5, 1, 32], strides=[1,... | true | true |
f70c79439c30f64e1f79aeb6fa3efae3b7615004 | 7,227 | py | Python | tests/test_get_pr_info.py | yamap55/pull_request_info_compile | afea4148dd7d44bb9cf939373455f9edb747bf7b | [
"MIT"
] | null | null | null | tests/test_get_pr_info.py | yamap55/pull_request_info_compile | afea4148dd7d44bb9cf939373455f9edb747bf7b | [
"MIT"
] | 4 | 2021-01-02T15:14:19.000Z | 2021-01-10T13:54:13.000Z | tests/test_get_pr_info.py | yamap55/pull_request_info_compile | afea4148dd7d44bb9cf939373455f9edb747bf7b | [
"MIT"
] | null | null | null | import re
from textwrap import dedent
from unittest import mock
from unittest.mock import PropertyMock
import pytest
from get_pr_info import extract_target_section, get_pr_number_from_commit_message, get_pr_summary
from github import BadCredentialsException, UnknownObjectException
class TestGetPrNumberFromCommitMess... | 29.497959 | 111 | 0.57133 | import re
from textwrap import dedent
from unittest import mock
from unittest.mock import PropertyMock
import pytest
from get_pr_info import extract_target_section, get_pr_number_from_commit_message, get_pr_summary
from github import BadCredentialsException, UnknownObjectException
class TestGetPrNumberFromCommitMess... | true | true |
f70c7bc02c5bc102e0195b41a552537b1676c819 | 9,914 | py | Python | 2.MOA-prediction/4.model_viz/scripts/nbconverted/0.blend_test_predictions.py | broadinstitute/lincs-profiling-comparison | 075c3bc60eeb3934fc42c30bae6aeed8cda1cd6d | [
"BSD-3-Clause"
] | 1 | 2021-07-20T07:47:02.000Z | 2021-07-20T07:47:02.000Z | 2.MOA-prediction/4.model_viz/scripts/nbconverted/0.blend_test_predictions.py | broadinstitute/lincs-profiling-comparison | 075c3bc60eeb3934fc42c30bae6aeed8cda1cd6d | [
"BSD-3-Clause"
] | 19 | 2020-10-24T20:55:27.000Z | 2021-08-13T16:26:30.000Z | 2.MOA-prediction/4.model_viz/scripts/nbconverted/0.blend_test_predictions.py | broadinstitute/lincs-profiling-comparison | 075c3bc60eeb3934fc42c30bae6aeed8cda1cd6d | [
"BSD-3-Clause"
] | 3 | 2020-10-24T18:14:07.000Z | 2021-06-24T17:36:25.000Z | #!/usr/bin/env python
# coding: utf-8
# ### - Ensemble/Blend the 4 model predictions into a single prediction
# In[1]:
import os
import datetime
from time import time
import pathlib
import pandas as pd
import numpy as np
from collections import defaultdict
from collections import Counter
# In[2]:
from sklearn.m... | 27.38674 | 140 | 0.719387 |
import os
import datetime
from time import time
import pathlib
import pandas as pd
import numpy as np
from collections import defaultdict
from collections import Counter
from sklearn.metrics import precision_recall_curve,average_precision_score
from sklearn.metrics import log_loss, roc_curve
from sklearn.metric... | true | true |
f70c7bc286d3778bb921c66dc8890c7d4ea43042 | 178 | py | Python | pyltr/__init__.py | Haiga/pyltr | 65e704e540fa104ccdf8143e61911ef57b70cf84 | [
"BSD-3-Clause"
] | 432 | 2015-09-17T19:36:33.000Z | 2022-03-26T17:06:48.000Z | pyltr/__init__.py | Haiga/pyltr | 65e704e540fa104ccdf8143e61911ef57b70cf84 | [
"BSD-3-Clause"
] | 24 | 2016-08-04T03:23:07.000Z | 2021-10-16T13:17:06.000Z | pyltr/__init__.py | Haiga/pyltr | 65e704e540fa104ccdf8143e61911ef57b70cf84 | [
"BSD-3-Clause"
] | 112 | 2016-01-16T01:49:35.000Z | 2022-03-21T06:01:40.000Z | """
Base module for pyltr.
We import all packages since it's not particularly expensive.
"""
from . import data
from . import metrics
from . import models
from . import util
| 13.692308 | 61 | 0.730337 |
from . import data
from . import metrics
from . import models
from . import util
| true | true |
f70c7bef02e009abc9db3e52e9872978d79a7cc5 | 30,886 | py | Python | modules/s3db/evr.py | mswdresden/AsylumEden | a68ee08f9f7031974ec12ec327d00c5d975a740a | [
"MIT"
] | 1 | 2017-07-22T18:49:34.000Z | 2017-07-22T18:49:34.000Z | modules/s3db/evr.py | vpccalderara/sahana | 6eb3f9798879dfa51bbe5d2b84829b1402671499 | [
"MIT"
] | null | null | null | modules/s3db/evr.py | vpccalderara/sahana | 6eb3f9798879dfa51bbe5d2b84829b1402671499 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
""" Sahana Eden Evacuees Registry Model
@copyright: 2015-2017 (c) Sahana Software Foundation
@license: MIT
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 Soft... | 41.737838 | 127 | 0.400117 |
__all__ = ("S3EVRCaseModel",
"evr_rheader",
"evr_AddGroupMembers",
)
from gluon import *
from ..s3 import *
class S3EVRCaseModel(S3Model):
names = ("evr_case",
"evr_medical_details",
)
def model(self):
T = current.T
settings = cur... | true | true |
f70c7c8d3e72df63f8d1547bb698e8f8588b13ff | 3,574 | py | Python | rindr/settings.py | claird160/rindr | 0ab9d77edf6258ab8f304fd4f1c5f92d96ff7a60 | [
"MIT"
] | null | null | null | rindr/settings.py | claird160/rindr | 0ab9d77edf6258ab8f304fd4f1c5f92d96ff7a60 | [
"MIT"
] | null | null | null | rindr/settings.py | claird160/rindr | 0ab9d77edf6258ab8f304fd4f1c5f92d96ff7a60 | [
"MIT"
] | null | null | null | """
Django settings for rindr project.
Generated by 'django-admin startproject' using Django 3.2.8.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
from pathlib i... | 24.648276 | 91 | 0.678232 |
from pathlib import Path
from decouple import config
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = config("SECRET_KEY")
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'dja... | true | true |
f70c7cead4990040f286a584fa949ea7edd561a9 | 1,347 | py | Python | apysc/_display/flip_interface_helper.py | ynsnf/apysc | b10ffaf76ec6beb187477d0a744fca00e3efc3fb | [
"MIT"
] | 16 | 2021-04-16T02:01:29.000Z | 2022-01-01T08:53:49.000Z | apysc/_display/flip_interface_helper.py | ynsnf/apysc | b10ffaf76ec6beb187477d0a744fca00e3efc3fb | [
"MIT"
] | 613 | 2021-03-24T03:37:38.000Z | 2022-03-26T10:58:37.000Z | apysc/_display/flip_interface_helper.py | simon-ritchie/apyscript | c319f8ab2f1f5f7fad8d2a8b4fc06e7195476279 | [
"MIT"
] | 2 | 2021-06-20T07:32:58.000Z | 2021-12-26T08:22:11.000Z | """The helper module for the flip interfaces.
"""
from enum import Enum
from apysc._type.boolean import Boolean
class Axis(Enum):
X = 'x'
Y = 'y'
def make_flip_update_expression(
*, before_value: Boolean, after_value: Boolean,
axis: Axis, interface_variable_name: str) -> str... | 26.411765 | 69 | 0.604306 |
from enum import Enum
from apysc._type.boolean import Boolean
class Axis(Enum):
X = 'x'
Y = 'y'
def make_flip_update_expression(
*, before_value: Boolean, after_value: Boolean,
axis: Axis, interface_variable_name: str) -> str:
from apysc._type import value_util
befor... | true | true |
f70c7d5536cf9053acba7375cc7748accbada4ba | 248 | py | Python | pythonclub/club/admin.py | janainfanger/itc240-webapp-1 | 0e9f9b0e12d82bf49ed1996ef2ed4ea21d3adc23 | [
"Apache-2.0"
] | null | null | null | pythonclub/club/admin.py | janainfanger/itc240-webapp-1 | 0e9f9b0e12d82bf49ed1996ef2ed4ea21d3adc23 | [
"Apache-2.0"
] | null | null | null | pythonclub/club/admin.py | janainfanger/itc240-webapp-1 | 0e9f9b0e12d82bf49ed1996ef2ed4ea21d3adc23 | [
"Apache-2.0"
] | null | null | null | from django.contrib import admin
from .models import Meeting, MeetingMinutes, Resource, Event
# Register your models here.
admin.site.register(Meeting)
admin.site.register(MeetingMinutes)
admin.site.register(Resource)
admin.site.register(Event)
| 22.545455 | 60 | 0.814516 | from django.contrib import admin
from .models import Meeting, MeetingMinutes, Resource, Event
admin.site.register(Meeting)
admin.site.register(MeetingMinutes)
admin.site.register(Resource)
admin.site.register(Event)
| true | true |
f70c7d6e65fb0d26ccd64aba1732de80b1421d06 | 418,199 | py | Python | cfgov/hmda/resources/loan_file_metadata.py | higs4281/cfgov-refresh | a02b193fb2373d443265c21845adf8a196e05675 | [
"CC0-1.0"
] | null | null | null | cfgov/hmda/resources/loan_file_metadata.py | higs4281/cfgov-refresh | a02b193fb2373d443265c21845adf8a196e05675 | [
"CC0-1.0"
] | null | null | null | cfgov/hmda/resources/loan_file_metadata.py | higs4281/cfgov-refresh | a02b193fb2373d443265c21845adf8a196e05675 | [
"CC0-1.0"
] | null | null | null | # flake8: noqa E501
from hmda.models.hmda_data_file import HmdaDataFile
# Access this using HMDA_DATA_FILES[geo][field_descriptions][records]
LOAN_FILE_METADATA = {
'nationwide': {
'labels': {
'first-lien-owner-occupied-1-4-family-records': {
'2016': HmdaDataFile('hmda_2016_nat... | 92.033231 | 141 | 0.623882 | from hmda.models.hmda_data_file import HmdaDataFile
LOAN_FILE_METADATA = {
'nationwide': {
'labels': {
'first-lien-owner-occupied-1-4-family-records': {
'2016': HmdaDataFile('hmda_2016_nationwide_first-lien-owner-occupied-1-4-family-records_labels.zip', '7036352', '482.83 MB'),... | true | true |
f70c7d7cbcef3d7c08dc59ed660a624713cbabbe | 2,285 | py | Python | contenido_gc.py | euribates/biopython | dcd4e1cde413d52adb91ac874de2f2bdd8d214e5 | [
"MIT"
] | null | null | null | contenido_gc.py | euribates/biopython | dcd4e1cde413d52adb91ac874de2f2bdd8d214e5 | [
"MIT"
] | null | null | null | contenido_gc.py | euribates/biopython | dcd4e1cde413d52adb91ac874de2f2bdd8d214e5 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# CALCULATION OF GC CONTENT (GENES)
import os
import logging
import argparse
import fastalib
from fileutils import safe_filename
def get_option_args():
args_parser = argparse.ArgumentParser(
description='Found GC in FASTA files of a directory',
)
args_parser.add_argument(
... | 32.642857 | 81 | 0.557549 |
import os
import logging
import argparse
import fastalib
from fileutils import safe_filename
def get_option_args():
args_parser = argparse.ArgumentParser(
description='Found GC in FASTA files of a directory',
)
args_parser.add_argument(
'path',
help='Path where look for FAST... | true | true |
f70c7e01657553cf9cb3359901dd1b4a4e60dc7a | 339,392 | py | Python | pkgs/ops-pkg/src/genie/libs/ops/bgp/iosxr/yang/tests/bgp_output.py | miott/genielibs | 6464642cdd67aa2367bdbb12561af4bb060e5e62 | [
"Apache-2.0"
] | 94 | 2018-04-30T20:29:15.000Z | 2022-03-29T13:40:31.000Z | pkgs/ops-pkg/src/genie/libs/ops/bgp/iosxr/yang/tests/bgp_output.py | miott/genielibs | 6464642cdd67aa2367bdbb12561af4bb060e5e62 | [
"Apache-2.0"
] | 67 | 2018-12-06T21:08:09.000Z | 2022-03-29T18:00:46.000Z | pkgs/ops-pkg/src/genie/libs/ops/bgp/iosxr/yang/tests/bgp_output.py | miott/genielibs | 6464642cdd67aa2367bdbb12561af4bb060e5e62 | [
"Apache-2.0"
] | 49 | 2018-06-29T18:59:03.000Z | 2022-03-10T02:07:59.000Z | '''
BGP Genie Ops Object Outputs for IOSXR.
'''
import xml.etree.ElementTree as ET
class BgpOutput(object):
############################################################################
# BGP INFO
############################################################################
... | 87.53985 | 203 | 0.183849 |
import xml.etree.ElementTree as ET
class BgpOutput(object):
ShowBgpInstances = {
"instance": {
"test1": {
"num_vrfs": 0,
"instance_id": 1,
"placed_grp": "bgp2_1",
"bgp_id": 333
},
"default... | true | true |
f70c7f1ef25ad37c74319931832954fc4f96fb85 | 21,207 | py | Python | mapexport.py | muffinjets/LADXR | bbd82a5b7bac015561bb6a4cfe1c5fa017f827f5 | [
"MIT"
] | 13 | 2020-09-13T16:50:28.000Z | 2022-03-22T20:49:54.000Z | mapexport.py | muffinjets/LADXR | bbd82a5b7bac015561bb6a4cfe1c5fa017f827f5 | [
"MIT"
] | 10 | 2020-06-27T12:34:38.000Z | 2022-01-03T12:15:42.000Z | mapexport.py | muffinjets/LADXR | bbd82a5b7bac015561bb6a4cfe1c5fa017f827f5 | [
"MIT"
] | 18 | 2020-05-29T17:48:04.000Z | 2022-02-08T03:36:08.000Z | import PIL.Image, PIL.ImageDraw
from roomEditor import RoomEditor, ObjectHorizontal, ObjectVertical, ObjectWarp
class RenderedMap:
WALL_UP = 0x01
WALL_DOWN = 0x02
WALL_LEFT = 0x04
WALL_RIGHT = 0x08
def __init__(self, floor_object, overworld=False):
self.objects = {}
se... | 46.002169 | 151 | 0.486443 | import PIL.Image, PIL.ImageDraw
from roomEditor import RoomEditor, ObjectHorizontal, ObjectVertical, ObjectWarp
class RenderedMap:
WALL_UP = 0x01
WALL_DOWN = 0x02
WALL_LEFT = 0x04
WALL_RIGHT = 0x08
def __init__(self, floor_object, overworld=False):
self.objects = {}
se... | true | true |
f70c7f2258ce588444cf46d6c8affc4c9555203e | 3,585 | py | Python | python/paddle/fluid/layers/ops.py | skylarch/Paddle | d58d8df6f5f7aa6fd2f0780f87475055db57a80d | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/layers/ops.py | skylarch/Paddle | d58d8df6f5f7aa6fd2f0780f87475055db57a80d | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/layers/ops.py | skylarch/Paddle | d58d8df6f5f7aa6fd2f0780f87475055db57a80d | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 22.40625 | 74 | 0.641004 | from .layer_function_generator import generate_layer_fn
__activations__ = [
'sigmoid',
'logsigmoid',
'exp',
'tanh',
'tanh_shrink',
'softshrink',
'sqrt',
'abs',
'ceil',
'floor',
'cos',
'sin',
'round',
'reciprocal',
'square',
'softplus',
'softsign',
... | true | true |
f70c80c259fb8d5441fc2b9fa843bb40401a27f5 | 1,435 | py | Python | app/scripts/check_files.py | PromoFaux/plex-utills | 570e2e4525b992978780b6a195df94c674c94ac3 | [
"MIT"
] | 179 | 2020-02-27T01:09:32.000Z | 2022-03-28T21:56:20.000Z | app/scripts/check_files.py | PromoFaux/plex-utills | 570e2e4525b992978780b6a195df94c674c94ac3 | [
"MIT"
] | 94 | 2020-03-03T03:22:42.000Z | 2022-03-28T20:13:22.000Z | app/scripts/check_files.py | PromoFaux/plex-utills | 570e2e4525b992978780b6a195df94c674c94ac3 | [
"MIT"
] | 36 | 2020-02-28T13:58:54.000Z | 2022-03-26T10:04:25.000Z | #!/usr/bin/python
import os
import sys
import time
from configparser import ConfigParser
from plexapi.server import PlexServer
import re
config_object = ConfigParser()
config_object.read("/config/config.ini")
server = config_object["PLEXSERVER"]
options = config_object["OPTIONS"]
baseurl = (server["PLEX_... | 35 | 110 | 0.583275 | import os
import sys
import time
from configparser import ConfigParser
from plexapi.server import PlexServer
import re
config_object = ConfigParser()
config_object.read("/config/config.ini")
server = config_object["PLEXSERVER"]
options = config_object["OPTIONS"]
baseurl = (server["PLEX_URL"])
token = (se... | true | true |
f70c82ccc483cb64421eca8eaf429e62c0793614 | 7,628 | py | Python | mint/daemon/keychain_server.py | MintNetwork/mint-blockchain | 65ec05a015a07664ed25f83efa736065a17f7d7a | [
"Apache-2.0"
] | 12 | 2021-08-18T20:53:31.000Z | 2022-03-15T21:45:13.000Z | mint/daemon/keychain_server.py | MintNetwork/mint-blockchain | 65ec05a015a07664ed25f83efa736065a17f7d7a | [
"Apache-2.0"
] | 34 | 2021-08-18T19:12:11.000Z | 2022-01-06T17:15:34.000Z | mint/daemon/keychain_server.py | MintNetwork/mint-blockchain | 65ec05a015a07664ed25f83efa736065a17f7d7a | [
"Apache-2.0"
] | 7 | 2021-08-18T20:53:34.000Z | 2022-03-15T08:37:40.000Z | import logging
from blspy import PrivateKey
from mint.cmds.init_funcs import check_keys
from mint.util.keychain import Keychain
from pathlib import Path
from typing import Any, Dict, List, Optional, cast
# Commands that are handled by the KeychainServer
keychain_commands = [
"add_private_key",
"check_keys",
... | 40.574468 | 106 | 0.635947 | import logging
from blspy import PrivateKey
from mint.cmds.init_funcs import check_keys
from mint.util.keychain import Keychain
from pathlib import Path
from typing import Any, Dict, List, Optional, cast
keychain_commands = [
"add_private_key",
"check_keys",
"delete_all_keys",
"delete_key_by_fingerpri... | true | true |
f70c82dd8e7f66cb39383a76d97c579bef26798c | 1,279 | py | Python | Preprocessing.py | maciej-gajewski/gotta-catch-ai | 510d593351266e929173aa5e06aaad5df3350bcd | [
"MIT"
] | null | null | null | Preprocessing.py | maciej-gajewski/gotta-catch-ai | 510d593351266e929173aa5e06aaad5df3350bcd | [
"MIT"
] | null | null | null | Preprocessing.py | maciej-gajewski/gotta-catch-ai | 510d593351266e929173aa5e06aaad5df3350bcd | [
"MIT"
] | null | null | null | #Importing packages
import shutil
import os
import csv
#Preprocessing first dataset
file = "./Pokemon/data/pokemon_types_names.csv"
with open(file,'r') as f:
reader = csv.reader(f)
next(reader,None) #Skip the header
pkm_dict1 = {rows[1]:rows[2] for rows in reader}
for pkm_name, pkm_type... | 33.657895 | 94 | 0.602033 |
import shutil
import os
import csv
file = "./Pokemon/data/pokemon_types_names.csv"
with open(file,'r') as f:
reader = csv.reader(f)
next(reader,None) pkm_dict1 = {rows[1]:rows[2] for rows in reader}
for pkm_name, pkm_type in pkm_dict1.items():
source = './Pokemon/pokemon-generat... | true | true |
f70c83141455e50f059168c60684b7ee1d9db2aa | 13,702 | py | Python | eagr/client/client_side_middleware.py | kensho-technologies/eagr | fc4a2ec21d22ebc753e194e5644fbbad1ae44dda | [
"Apache-2.0"
] | 14 | 2020-03-05T20:25:04.000Z | 2021-12-18T02:38:33.000Z | eagr/client/client_side_middleware.py | kensho-technologies/eagr | fc4a2ec21d22ebc753e194e5644fbbad1ae44dda | [
"Apache-2.0"
] | 4 | 2020-05-21T15:02:57.000Z | 2020-12-03T12:54:20.000Z | eagr/client/client_side_middleware.py | kensho-technologies/eagr | fc4a2ec21d22ebc753e194e5644fbbad1ae44dda | [
"Apache-2.0"
] | 1 | 2020-08-07T23:13:31.000Z | 2020-08-07T23:13:31.000Z | # Copyright 2020-present Kensho Technologies, LLC.
"""Implementing client-side grpc interceptors"""
import functools
import json
import backoff
import grpc
import prometheus_client
CLIENTSIDE_METRICS_HISTO = prometheus_client.Histogram(
"clientside_grpc_endpoint",
"Response time histogram for grpc endpoints ... | 38.488764 | 100 | 0.66837 | import functools
import json
import backoff
import grpc
import prometheus_client
CLIENTSIDE_METRICS_HISTO = prometheus_client.Histogram(
"clientside_grpc_endpoint",
"Response time histogram for grpc endpoints from the client-side",
labelnames=("client_name", "server_name", "service", "endpoint"),
)
CLIEN... | true | true |
f70c835e6e69c7e01344ba1da7beafadb5e0f723 | 8,288 | py | Python | rest-service/manager_rest/rest/rest_utils.py | yeshess/cloudify-manager | 04dd199ce7df54355b87e9594f9db9fb1582924b | [
"Apache-2.0"
] | null | null | null | rest-service/manager_rest/rest/rest_utils.py | yeshess/cloudify-manager | 04dd199ce7df54355b87e9594f9db9fb1582924b | [
"Apache-2.0"
] | null | null | null | rest-service/manager_rest/rest/rest_utils.py | yeshess/cloudify-manager | 04dd199ce7df54355b87e9594f9db9fb1582924b | [
"Apache-2.0"
] | null | null | null | #########
# Copyright (c) 2015 GigaSpaces Technologies 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
#
# Unless... | 33.554656 | 79 | 0.664696 |
import copy
import urllib
import subprocess
from flask import current_app
from string import ascii_letters
from flask import request, make_response
from flask_restful.reqparse import Argument
from flask_restful.reqparse import RequestParser
from contextlib import contextmanager
from manager_rest import manager_exce... | true | true |
f70c847bebf0a1aa589b994ffb769592faf8f965 | 1,156 | py | Python | plans/fixed_ensemble_vggish_linear_4.py | dbis-uibk/MediaEval2021 | 14d754d9cea36415090aaa115db81f5ace465964 | [
"BSD-2-Clause"
] | 1 | 2022-03-31T07:28:12.000Z | 2022-03-31T07:28:12.000Z | plans/fixed_ensemble_vggish_linear_4.py | dbis-uibk/MediaEval2021 | 14d754d9cea36415090aaa115db81f5ace465964 | [
"BSD-2-Clause"
] | null | null | null | plans/fixed_ensemble_vggish_linear_4.py | dbis-uibk/MediaEval2021 | 14d754d9cea36415090aaa115db81f5ace465964 | [
"BSD-2-Clause"
] | null | null | null | """Ensemble plan manually split by type moode/theme."""
import json
from dbispipeline.evaluators import FixedSplitEvaluator
from dbispipeline.evaluators import ModelCallbackWrapper
import numpy as np
from sklearn.pipeline import Pipeline
from mediaeval2021 import common
from mediaeval2021.dataloaders.melspectrograms ... | 26.272727 | 76 | 0.718858 | import json
from dbispipeline.evaluators import FixedSplitEvaluator
from dbispipeline.evaluators import ModelCallbackWrapper
import numpy as np
from sklearn.pipeline import Pipeline
from mediaeval2021 import common
from mediaeval2021.dataloaders.melspectrograms import MelSpectPickleLoader
from mediaeval2021.models.en... | true | true |
f70c854ed6d40c821fd014e478a79120bd10049b | 2,932 | py | Python | lldb/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestGDBRemoteLoad.py | medismailben/llvm-project | e334a839032fe500c3bba22bf976ab7af13ce1c1 | [
"Apache-2.0"
] | 765 | 2015-12-03T16:44:59.000Z | 2022-03-07T12:41:10.000Z | packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestGDBRemoteLoad.py | DalavanCloud/lldb | e913eaf2468290fb94c767d474d611b41a84dd69 | [
"Apache-2.0"
] | 1,815 | 2015-12-11T23:56:05.000Z | 2020-01-10T19:28:43.000Z | packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestGDBRemoteLoad.py | DalavanCloud/lldb | e913eaf2468290fb94c767d474d611b41a84dd69 | [
"Apache-2.0"
] | 284 | 2015-12-03T16:47:25.000Z | 2022-03-12T05:39:48.000Z | import lldb
from lldbsuite.test.lldbtest import *
from lldbsuite.test.decorators import *
from gdbclientutils import *
class TestGDBRemoteLoad(GDBRemoteTestBase):
def setUp(self):
super(TestGDBRemoteLoad, self).setUp()
self._initial_platform = lldb.DBG.GetSelectedPlatform()
def tearDown(self... | 36.197531 | 83 | 0.594134 | import lldb
from lldbsuite.test.lldbtest import *
from lldbsuite.test.decorators import *
from gdbclientutils import *
class TestGDBRemoteLoad(GDBRemoteTestBase):
def setUp(self):
super(TestGDBRemoteLoad, self).setUp()
self._initial_platform = lldb.DBG.GetSelectedPlatform()
def tearDown(self... | true | true |
f70c8689b3fa9172e75204bc9e12eafd938d8501 | 1,112 | py | Python | load-database/createbulk.py | jeantardelli/data-engineering-with-python | d547a20ff1464c945fd6c0b6a1a805fd0b4b227a | [
"MIT"
] | 6 | 2020-12-01T20:30:25.000Z | 2022-02-02T17:28:49.000Z | load-database/createbulk.py | jeantardelli/data-engineering-with-python | d547a20ff1464c945fd6c0b6a1a805fd0b4b227a | [
"MIT"
] | null | null | null | load-database/createbulk.py | jeantardelli/data-engineering-with-python | d547a20ff1464c945fd6c0b6a1a805fd0b4b227a | [
"MIT"
] | 2 | 2021-06-10T15:16:42.000Z | 2022-03-22T20:36:09.000Z | """createbulk
This module illustrates how to connect to MySQL and load bulk data in python
using the mysql-connector-python library.
"""
import mysql.connector
from faker import Faker
# Create a connection to MySQL
db = mysql.connector.connect(option_files="../sql-user/my.ini")
cursor = db.cursor()
# Create Faker in... | 25.860465 | 93 | 0.604317 | import mysql.connector
from faker import Faker
db = mysql.connector.connect(option_files="../sql-user/my.ini")
cursor = db.cursor()
fake = Faker()
sql = """INSERT INTO
dataengineering.people (name, age, street, city, state, zip, lng, lat)
VALUES
(%(name)s, %(age)s, %(street)s, %(... | true | true |
f70c876b372d9d78e012d9a9197fbb06a087e3dc | 5,847 | py | Python | using_microservices/workflows/example3/allies_prediction_workflow.py | MD-Studio/MDStudio_examples | 16919769ee4d69e598683d192e98649a6345bd0b | [
"Apache-2.0"
] | null | null | null | using_microservices/workflows/example3/allies_prediction_workflow.py | MD-Studio/MDStudio_examples | 16919769ee4d69e598683d192e98649a6345bd0b | [
"Apache-2.0"
] | null | null | null | using_microservices/workflows/example3/allies_prediction_workflow.py | MD-Studio/MDStudio_examples | 16919769ee4d69e598683d192e98649a6345bd0b | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import pickle
from autobahn.twisted.util import sleep
from mdstudio.deferred.chainable import chainable
from mdstudio.component.session import ComponentSession
from mdstudio.runner import main
from mdstudio_workflow import Workflow
class LIEPredictionWorkflow(ComponentSession):
... | 43.962406 | 116 | 0.635198 |
import os
import pickle
from autobahn.twisted.util import sleep
from mdstudio.deferred.chainable import chainable
from mdstudio.component.session import ComponentSession
from mdstudio.runner import main
from mdstudio_workflow import Workflow
class LIEPredictionWorkflow(ComponentSession):
def authorize_reques... | true | true |
f70c878b02f3fda19aefdfd9b267bced09c2c057 | 1,909 | py | Python | tests/crystallography/test_direct_metric_tensor.py | drix00/ElectronDiffraction | 9dc258d90d0b73745b904b1bb6e1e3e794403a27 | [
"Apache-2.0"
] | null | null | null | tests/crystallography/test_direct_metric_tensor.py | drix00/ElectronDiffraction | 9dc258d90d0b73745b904b1bb6e1e3e794403a27 | [
"Apache-2.0"
] | null | null | null | tests/crystallography/test_direct_metric_tensor.py | drix00/ElectronDiffraction | 9dc258d90d0b73745b904b1bb6e1e3e794403a27 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
.. py:currentmodule:: test_direct_metric_tensor
:synopsis: Tests for the module :py:mod:`direct_metric_tensor`
.. moduleauthor:: Hendrix Demers <hendrix.demers@mail.mcgill.ca>
Tests for the module :py:mod:`direct_metric_tensor`.
"""
##############################... | 25.797297 | 87 | 0.632268 |
import unittest
import electrondiffraction.crystallography.direct_metric_tensor as direct_metric_tensor
class Test_direct_metric_tensor(unittest.TestCase):
def setUp(self):
unittest.TestCase.setUp(self)
def tearDown(self):
unittest.TestCase.tearDown(self)
def testSkeleton(self)... | true | true |
f70c87fbcd1a5396c99536a27f7e3ca06a99465c | 916 | py | Python | setup.py | forslund/librespot-python | 7a340b1b20889e1afae47aa0f433a0893f4290f1 | [
"Apache-2.0"
] | 64 | 2021-02-24T06:46:34.000Z | 2022-03-29T11:33:46.000Z | setup.py | forslund/librespot-python | 7a340b1b20889e1afae47aa0f433a0893f4290f1 | [
"Apache-2.0"
] | 16 | 2021-04-24T12:25:30.000Z | 2022-02-19T00:02:44.000Z | setup.py | forslund/librespot-python | 7a340b1b20889e1afae47aa0f433a0893f4290f1 | [
"Apache-2.0"
] | 22 | 2021-04-05T23:57:14.000Z | 2022-03-10T04:45:08.000Z | import setuptools
setuptools.setup(name="librespot",
version="0.0.1",
description="Open Source Spotify Client",
long_description=open("README.md").read(),
long_description_content_type="text/markdown",
author="kokarare1212",
... | 43.619048 | 74 | 0.494541 | import setuptools
setuptools.setup(name="librespot",
version="0.0.1",
description="Open Source Spotify Client",
long_description=open("README.md").read(),
long_description_content_type="text/markdown",
author="kokarare1212",
... | true | true |
f70c8a2e1832207b44ba61a052a45f916f0afa0d | 18,912 | py | Python | regain/covariance/time_graphical_lasso_.py | veronicatozzo/regain | 5eaa9685eb34afa77abaf80a4e5764444bc95dd7 | [
"BSD-3-Clause"
] | null | null | null | regain/covariance/time_graphical_lasso_.py | veronicatozzo/regain | 5eaa9685eb34afa77abaf80a4e5764444bc95dd7 | [
"BSD-3-Clause"
] | null | null | null | regain/covariance/time_graphical_lasso_.py | veronicatozzo/regain | 5eaa9685eb34afa77abaf80a4e5764444bc95dd7 | [
"BSD-3-Clause"
] | null | null | null | # BSD 3-Clause License
# Copyright (c) 2017, Federico T.
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice, this
# list o... | 35.750473 | 80 | 0.62003 |
from __future__ import division
import warnings
import numpy as np
from scipy import linalg
from six.moves import map, range, zip
from sklearn.covariance import empirical_covariance, log_likelihood
from sklearn.utils.extmath import squared_norm
from sklearn.utils.validation import check_X_y
from regain.covaria... | true | true |
f70c8a58a8c830bc91bf765992a9befc181edfe7 | 808 | py | Python | src/causal2020/graphs/rum.py | hassanobeid1994/tr_b_causal_2020 | 1ffaeb7dcefccf5e1f24c459e9a2f140b2a052a5 | [
"MIT"
] | null | null | null | src/causal2020/graphs/rum.py | hassanobeid1994/tr_b_causal_2020 | 1ffaeb7dcefccf5e1f24c459e9a2f140b2a052a5 | [
"MIT"
] | 89 | 2020-02-10T02:52:11.000Z | 2020-06-23T03:50:27.000Z | src/causal2020/graphs/rum.py | hassan-obeid/tr_b_causal_2020 | 1ffaeb7dcefccf5e1f24c459e9a2f140b2a052a5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Causal graph for the random utility model in Ben-Akiva et al. (2002).
References
----------
Ben-Akiva, Moshe, Joan Walker, Adriana T. Bernardino, Dinesh A. Gopinath,
Taka Morikawa, and Amalia Polydoropoulou. "Integration of choice and latent
variable models." Perpetual motion: Travel behavi... | 32.32 | 79 | 0.736386 | import graphviz
RUM_GRAPH = graphviz.Digraph("Random Utility Maximization")
RUM_GRAPH.node("X", "Explanatory Variables", shape="box")
RUM_GRAPH.node("U", "Utility", shape="ellipse")
RUM_GRAPH.node("C", "Choice", shape="box")
RUM_GRAPH.edge("X", "U")
RUM_GRAPH.edge("U", "C")
| true | true |
f70c8ae86d1ee49a88424559123d137100d760ac | 4,726 | py | Python | evalml/tests/component_tests/test_prophet_regressor.py | peterataylor/evalml | 917f07845c4a319bb08c7aaa8df9e09623df11c8 | [
"BSD-3-Clause"
] | null | null | null | evalml/tests/component_tests/test_prophet_regressor.py | peterataylor/evalml | 917f07845c4a319bb08c7aaa8df9e09623df11c8 | [
"BSD-3-Clause"
] | null | null | null | evalml/tests/component_tests/test_prophet_regressor.py | peterataylor/evalml | 917f07845c4a319bb08c7aaa8df9e09623df11c8 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
import pandas as pd
import pytest
from pytest import importorskip
from evalml.model_family import ModelFamily
from evalml.pipelines.components import ProphetRegressor
from evalml.problem_types import ProblemTypes
prophet = importorskip("prophet", reason="Skipping test because prophet not installed"... | 29.72327 | 88 | 0.692975 | import numpy as np
import pandas as pd
import pytest
from pytest import importorskip
from evalml.model_family import ModelFamily
from evalml.pipelines.components import ProphetRegressor
from evalml.problem_types import ProblemTypes
prophet = importorskip("prophet", reason="Skipping test because prophet not installed"... | true | true |
f70c8b0953fb7f16415b90aca7c15aa492645bd2 | 2,990 | py | Python | test/SConsignFile/use-dbhash.py | moroten/scons | 20927b42ed4f0cb87f51287fa3b4b6cf915afcf8 | [
"MIT"
] | 1 | 2017-01-28T15:39:07.000Z | 2017-01-28T15:39:07.000Z | test/SConsignFile/use-dbhash.py | moroten/scons | 20927b42ed4f0cb87f51287fa3b4b6cf915afcf8 | [
"MIT"
] | 4 | 2019-04-11T16:27:45.000Z | 2019-04-11T23:56:30.000Z | test/SConsignFile/use-dbhash.py | moroten/scons | 20927b42ed4f0cb87f51287fa3b4b6cf915afcf8 | [
"MIT"
] | 2 | 2018-01-16T11:29:16.000Z | 2020-05-13T16:48:26.000Z | #!/usr/bin/env python
#
# __COPYRIGHT__
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
... | 30.824742 | 75 | 0.721405 |
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import TestSCons
_python_ = TestSCons._python_
test = TestSCons.TestSCons()
try:
import dbm.bsd
except ImportError:
test.skip_test('No dbhash in this version of Python; skipping test.\n')
test.subdir('subdir')
test.write('build.py', r"""
impo... | true | true |
f70c8b3a87ae45f179806ab4700928fb6bc1cd69 | 1,782 | py | Python | pyabc/distance/__init__.py | Pat-Laub/pyABC | f23f0ff8d430a8ce0a0c8253b45e19add9121992 | [
"BSD-3-Clause"
] | null | null | null | pyabc/distance/__init__.py | Pat-Laub/pyABC | f23f0ff8d430a8ce0a0c8253b45e19add9121992 | [
"BSD-3-Clause"
] | null | null | null | pyabc/distance/__init__.py | Pat-Laub/pyABC | f23f0ff8d430a8ce0a0c8253b45e19add9121992 | [
"BSD-3-Clause"
] | null | null | null | """
Distance functions
==================
Distance functions measure closeness of observed and sampled data. This
module implements various commonly used distance functions for ABC, featuring
a few advanced concepts.
For custom distance functions, either pass a plain function to ABCSMC or
subclass the pyabc.Distance ... | 25.098592 | 77 | 0.741302 |
from .base import (
Distance,
NoDistance,
IdentityFakeDistance,
AcceptAllDistance,
SimpleFunctionDistance,
to_distance)
from .distance import (
PNormDistance,
AdaptivePNormDistance,
ZScoreDistance,
PCADistance,
MinMaxDistance,
PercentileDistance,
RangeEstimatorDistan... | true | true |
f70c8be35cb4236006856c868141ae41ff613cea | 4,097 | py | Python | src/chembl_beaker/beaker/core_apps/D2Coords/views.py | chembl/chembl_beaker | 0ea3a8efc9220fce5334cb37ac2239e7189b44ef | [
"Apache-2.0"
] | 28 | 2015-08-12T07:22:48.000Z | 2022-02-26T03:50:27.000Z | src/chembl_beaker/beaker/core_apps/D2Coords/views.py | chembl/chembl_beaker | 0ea3a8efc9220fce5334cb37ac2239e7189b44ef | [
"Apache-2.0"
] | 18 | 2015-03-03T12:03:12.000Z | 2021-06-16T11:03:05.000Z | src/chembl_beaker/beaker/core_apps/D2Coords/views.py | chembl/chembl_beaker | 0ea3a8efc9220fce5334cb37ac2239e7189b44ef | [
"Apache-2.0"
] | 13 | 2015-02-16T12:35:01.000Z | 2021-08-02T09:40:30.000Z | __author__ = 'efelix'
# ----------------------------------------------------------------------------------------------------------------------
from rdkit.Chem import AllChem
from beaker import app
from bottle import request
from beaker.core_apps.D2Coords.impl import _ctab22D, _smiles22D, _is3D
from beaker.utils.io im... | 39.019048 | 120 | 0.537711 | __author__ = 'efelix'
from rdkit.Chem import AllChem
from beaker import app
from bottle import request
from beaker.core_apps.D2Coords.impl import _ctab22D, _smiles22D, _is3D
from beaker.utils.io import _parseFlag
def ctab22DView(data, params):
kwargs = dict()
kwargs['loadMol'] = _parseFlag(params.get('load... | true | true |
f70c8be6dacb09e488f064c302e8bff53ab16bbd | 4,368 | py | Python | main.py | cc37/PDFSummarizer | 6c36f25d405a7317f61c533e4b0f2733dac7cf04 | [
"MIT"
] | null | null | null | main.py | cc37/PDFSummarizer | 6c36f25d405a7317f61c533e4b0f2733dac7cf04 | [
"MIT"
] | null | null | null | main.py | cc37/PDFSummarizer | 6c36f25d405a7317f61c533e4b0f2733dac7cf04 | [
"MIT"
] | null | null | null | if __name__ == "__main__":
import os
import sys
import subprocess
import XMLReduction
#python2 main.py name.pdf 8.5 font
#need font because need to filter out text that matches in all other regards except font
#but also need to except font that starts exactly the same up to the end where it ... | 67.2 | 94 | 0.72207 | if __name__ == "__main__":
import os
import sys
import subprocess
import XMLReduction
#font match doesn't seem to be working the way I hoped so made it always true
#why that text still shows up is my code doing w... | false | true |
f70c8c4b1862864e3418e1969f0a535ab12ce6ad | 2,340 | py | Python | development/performance/langevin_error_example.py | choderalab/saltswap | d30804beb158960a62f94182c694df6dd9130fb8 | [
"MIT"
] | 3 | 2017-06-30T11:40:20.000Z | 2021-05-14T02:20:38.000Z | development/performance/langevin_error_example.py | choderalab/saltswap | d30804beb158960a62f94182c694df6dd9130fb8 | [
"MIT"
] | 19 | 2017-04-27T14:56:51.000Z | 2019-12-10T14:26:38.000Z | development/performance/langevin_error_example.py | choderalab/saltswap | d30804beb158960a62f94182c694df6dd9130fb8 | [
"MIT"
] | 2 | 2017-02-01T21:46:18.000Z | 2018-01-15T18:56:56.000Z | import numpy as np
from simtk import openmm, unit
from simtk.openmm import app
from openmmtools.testsystems import WaterBox
from openmmtools.integrators import ExternalPerturbationLangevinIntegrator
print('OpenMM version: ', openmm.version.full_version)
# Using one CPU thread
import os
os.environ['OPENMM_CPU_THREADS']... | 39.661017 | 152 | 0.789316 | import numpy as np
from simtk import openmm, unit
from simtk.openmm import app
from openmmtools.testsystems import WaterBox
from openmmtools.integrators import ExternalPerturbationLangevinIntegrator
print('OpenMM version: ', openmm.version.full_version)
import os
os.environ['OPENMM_CPU_THREADS'] = '1'
nonbonded_metho... | true | true |
f70c8c618feb024a795bc729d00c3537e6ed6965 | 9,087 | py | Python | ivy/dot_layout.py | AnonyQUIC/EPIC---Ivy | 316f17ff7d2fae400359ccb58177fbc8bf5c4551 | [
"MIT"
] | 113 | 2019-05-09T15:37:47.000Z | 2022-03-14T04:02:01.000Z | ivy/dot_layout.py | AnonyQUIC/EPIC---Ivy | 316f17ff7d2fae400359ccb58177fbc8bf5c4551 | [
"MIT"
] | 58 | 2019-09-03T15:42:29.000Z | 2021-01-15T02:20:29.000Z | ivy/dot_layout.py | AnonyQUIC/EPIC---Ivy | 316f17ff7d2fae400359ccb58177fbc8bf5c4551 | [
"MIT"
] | 40 | 2016-01-02T19:13:18.000Z | 2018-10-27T11:38:00.000Z | #
# Copyright (c) Microsoft Corporation. All Rights Reserved.
#
"""
Use DOT to layout a graph for cytoscape.js
TODO: add support for middle points in edges
"""
from __future__ import division
from collections import deque, defaultdict
import platform
if True or platform.system() == 'Windows':
from ivy_graphviz ... | 31.884211 | 110 | 0.541873 |
from __future__ import division
from collections import deque, defaultdict
import platform
if True or platform.system() == 'Windows':
from ivy_graphviz import AGraph
else:
from pygraphviz import AGraph
from ivy_utils import topological_sort
import ivy_utils as iu
def cubic_bezier_point(p0, p1, p2, p3, t... | true | true |
f70c8c9b8ac7368a5b5eb84ab7f548195df88c4b | 713 | py | Python | app/server/test/testWordService.py | hsadler/zentype2 | 08694727d65531b2c7bd0cea97f53c5a270d0f51 | [
"MIT"
] | null | null | null | app/server/test/testWordService.py | hsadler/zentype2 | 08694727d65531b2c7bd0cea97f53c5a270d0f51 | [
"MIT"
] | null | null | null | app/server/test/testWordService.py | hsadler/zentype2 | 08694727d65531b2c7bd0cea97f53c5a270d0f51 | [
"MIT"
] | null | null | null |
import sys
sys.path.append('..')
from data_object.word_data_object import WordDataObject
from service.word import Word
from service.language import Language
from utils.print import ppp
# random word list options
language = Language(Language.ENGLISH)
qwerty_difficulty_rank = {
'min': 0,
'max': 10000
}
frequency_ra... | 16.97619 | 55 | 0.746143 |
import sys
sys.path.append('..')
from data_object.word_data_object import WordDataObject
from service.word import Word
from service.language import Language
from utils.print import ppp
language = Language(Language.ENGLISH)
qwerty_difficulty_rank = {
'min': 0,
'max': 10000
}
frequency_rank = {
'min': 0,
'max': 1... | true | true |
f70c8ca1e6f009c0c1bb2b221e2877a82815c4ef | 33,141 | py | Python | tests/sessions_tests/tests.py | jmcdono362/django | 2014db50f4522243dba3190c640f64cf124d5b68 | [
"PSF-2.0",
"BSD-3-Clause"
] | 2 | 2021-03-13T21:16:42.000Z | 2022-01-12T00:29:14.000Z | tests/sessions_tests/tests.py | jmcdono362/django | 2014db50f4522243dba3190c640f64cf124d5b68 | [
"PSF-2.0",
"BSD-3-Clause"
] | 11 | 2020-03-24T15:46:05.000Z | 2022-03-11T23:20:58.000Z | tests/sessions_tests/tests.py | jmcdono362/django | 2014db50f4522243dba3190c640f64cf124d5b68 | [
"PSF-2.0",
"BSD-3-Clause"
] | 2 | 2018-01-08T08:14:29.000Z | 2020-11-04T08:46:29.000Z | import base64
import os
import shutil
import string
import tempfile
import unittest
from datetime import timedelta
from http import cookies
from django.conf import settings
from django.contrib.sessions.backends.base import UpdateError
from django.contrib.sessions.backends.cache import SessionStore as CacheSession
from... | 38.093103 | 106 | 0.666667 | import base64
import os
import shutil
import string
import tempfile
import unittest
from datetime import timedelta
from http import cookies
from django.conf import settings
from django.contrib.sessions.backends.base import UpdateError
from django.contrib.sessions.backends.cache import SessionStore as CacheSession
from... | true | true |
f70c8cb3a96a40a4af96607a654cf48df272e02d | 2,492 | py | Python | build/compiler/nds32le-elf-mculib-v3/nds32le-elf/lib/libstdc++.a-gdb.py | mu340881/alios_Integrate | a9f98898e13725423bd2379b2d766e2414c40e99 | [
"Apache-2.0"
] | null | null | null | build/compiler/nds32le-elf-mculib-v3/nds32le-elf/lib/libstdc++.a-gdb.py | mu340881/alios_Integrate | a9f98898e13725423bd2379b2d766e2414c40e99 | [
"Apache-2.0"
] | null | null | null | build/compiler/nds32le-elf-mculib-v3/nds32le-elf/lib/libstdc++.a-gdb.py | mu340881/alios_Integrate | a9f98898e13725423bd2379b2d766e2414c40e99 | [
"Apache-2.0"
] | 2 | 2019-10-22T09:26:23.000Z | 2019-12-20T07:28:20.000Z | # -*- python -*-
# Copyright (C) 2009-2014 Free Software Foundation, Inc.
# This program 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 versio... | 40.852459 | 135 | 0.726726 |
import sys
import gdb
import os
import os.path
pythondir = '/NOBACKUP/sqa10/sqa/build-bspv410/build-toolchain/build-2016-04-13/toolchain/nds32le-elf-mculib-v3/share/gcc-4.9.3/python'
libdir = '/NOBACKUP/sqa10/sqa/build-bspv410/build-toolchain/build-2016-04-13/toolchain/nds32le-elf-mculib-v3/nds32le-elf/lib'
# updat... | true | true |
f70c8e189b6fa80ed3959d3b92567217e2bb43d0 | 692 | py | Python | test_example.py | kaapitoshka/AntonStudy | d42a643e2f0a78e5257d3d2b876258e1e765db04 | [
"Apache-2.0"
] | null | null | null | test_example.py | kaapitoshka/AntonStudy | d42a643e2f0a78e5257d3d2b876258e1e765db04 | [
"Apache-2.0"
] | null | null | null | test_example.py | kaapitoshka/AntonStudy | d42a643e2f0a78e5257d3d2b876258e1e765db04 | [
"Apache-2.0"
] | null | null | null | import pytest
from selenium import webdriver
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time
@pytest.fixture(scope="session")
def driver(request):
wd=webdriver.Chrome()
request.addfinalizer(wd.quit)
return wd
def test_admin_log... | 32.952381 | 73 | 0.799133 | import pytest
from selenium import webdriver
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time
@pytest.fixture(scope="session")
def driver(request):
wd=webdriver.Chrome()
request.addfinalizer(wd.quit)
return wd
def test_admin_log... | true | true |
f70c8e39be15cb53affbe77a0dfe1db21f9d708e | 2,092 | py | Python | mammoth/style_reader/html_path_reader.py | tsaltena/python-mammoth | 6746d5f17377327d9947a10a1e8101f8810122e2 | [
"BSD-2-Clause"
] | null | null | null | mammoth/style_reader/html_path_reader.py | tsaltena/python-mammoth | 6746d5f17377327d9947a10a1e8101f8810122e2 | [
"BSD-2-Clause"
] | null | null | null | mammoth/style_reader/html_path_reader.py | tsaltena/python-mammoth | 6746d5f17377327d9947a10a1e8101f8810122e2 | [
"BSD-2-Clause"
] | null | null | null | from parsimonious.grammar import Grammar
from .. import html_paths
def read_html_path(string):
path_node = _grammar.parse(string)
return read_html_path_node(path_node)
def read_html_path_node(path_node):
if path_node.children[0].expr_name == "ignore":
return html_paths.ignore
elif path_node... | 22.255319 | 86 | 0.721319 | from parsimonious.grammar import Grammar
from .. import html_paths
def read_html_path(string):
path_node = _grammar.parse(string)
return read_html_path_node(path_node)
def read_html_path_node(path_node):
if path_node.children[0].expr_name == "ignore":
return html_paths.ignore
elif path_node... | true | true |
f70c8f55fb8d45c12d48988d6f13b08b0ec2fcfd | 3,899 | py | Python | glit/repo.py | vandmo/glit | d29b685c2a836e6fe52068f8e5c89393a47cc23f | [
"Apache-2.0"
] | 2 | 2018-10-31T06:41:05.000Z | 2018-10-31T07:50:28.000Z | glit/repo.py | vandmo/plit | d29b685c2a836e6fe52068f8e5c89393a47cc23f | [
"Apache-2.0"
] | null | null | null | glit/repo.py | vandmo/plit | d29b685c2a836e6fe52068f8e5c89393a47cc23f | [
"Apache-2.0"
] | null | null | null | from . import git
import os
from .utils import errordie, mkpath, msg
def _trim(lines):
stripped = [line.strip() for line in lines]
return [line for line in stripped if line and not line.startswith('#')]
def _git_destname(repository):
git_folder = repository.rsplit('/', 1)[1]
if git_folder.endswith('... | 30.460938 | 86 | 0.611182 | from . import git
import os
from .utils import errordie, mkpath, msg
def _trim(lines):
stripped = [line.strip() for line in lines]
return [line for line in stripped if line and not line.startswith('#')]
def _git_destname(repository):
git_folder = repository.rsplit('/', 1)[1]
if git_folder.endswith('... | true | true |
f70c90492de0b23222eb9e58cbb472345cf3c226 | 1,621 | py | Python | azure-batch/azure/batch/models/task_id_range.py | HydAu/AzureSDKForPython | 5cbe34e9e0b8ea1faacc9f205633ccc0b885c0f3 | [
"Apache-2.0"
] | null | null | null | azure-batch/azure/batch/models/task_id_range.py | HydAu/AzureSDKForPython | 5cbe34e9e0b8ea1faacc9f205633ccc0b885c0f3 | [
"Apache-2.0"
] | null | null | null | azure-batch/azure/batch/models/task_id_range.py | HydAu/AzureSDKForPython | 5cbe34e9e0b8ea1faacc9f205633ccc0b885c0f3 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft and contributors. 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 ... | 32.42 | 76 | 0.611968 |
from msrest.serialization import Model
class TaskIdRange(Model):
_validation = {
'start': {'required': True},
'end': {'required': True},
}
_attribute_map = {
'start': {'key': 'start', 'type': 'int'},
'end': {'key': 'end', 'type': 'int'},
}
def __init__(self, sta... | true | true |
f70c906712870c5ce6e99203c651af3b92bc28a8 | 32,190 | py | Python | admsInput/admsInputDataRetriever.py | mdhillmancmcl/TheWorldAvatar-CMCL-Fork | 011aee78c016b76762eaf511c78fabe3f98189f4 | [
"MIT"
] | 21 | 2021-03-08T01:58:25.000Z | 2022-03-09T15:46:16.000Z | admsInput/admsInputDataRetriever.py | mdhillmancmcl/TheWorldAvatar-CMCL-Fork | 011aee78c016b76762eaf511c78fabe3f98189f4 | [
"MIT"
] | 63 | 2021-05-04T15:05:30.000Z | 2022-03-23T14:32:29.000Z | admsInput/admsInputDataRetriever.py | mdhillmancmcl/TheWorldAvatar-CMCL-Fork | 011aee78c016b76762eaf511c78fabe3f98189f4 | [
"MIT"
] | 15 | 2021-03-08T07:52:03.000Z | 2022-03-29T04:46:20.000Z | '''
module that retreives and pack adms input info
'''
import rdflib
from pyproj import Proj, transform
import requests
import math
import sys
import os
import rdflib.plugins.sparql.results.jsonresults as jsresult
from collections import namedtuple
from admsSrc import admsSrc
from admsPolygon import Polygon
import cob... | 44.217033 | 511 | 0.564461 | import rdflib
from pyproj import Proj, transform
import requests
import math
import sys
import os
import rdflib.plugins.sparql.results.jsonresults as jsresult
from collections import namedtuple
from admsSrc import admsSrc
from admsPolygon import Polygon
import cobbling
class admsInputDataRetriever(object):
BDN ... | true | true |
f70c91590d30de58fe09b0711b50eb211f5a6ef8 | 36,807 | py | Python | oscar/lib/python3.6/site-packages/_pytest/config/__init__.py | bcruz97/django-oscar | df3dc1d99e70765a6c95a67f5b076644cd482852 | [
"BSD-3-Clause"
] | 445 | 2019-01-26T13:50:26.000Z | 2022-03-18T05:17:38.000Z | Library/lib/python3.7/site-packages/_pytest/config/__init__.py | gengyong/Carnets | 8930a14f69360d4db115a85ff9e0f6efa80fa2e7 | [
"BSD-3-Clause"
] | 242 | 2019-01-29T15:48:27.000Z | 2022-03-31T22:09:21.000Z | Library/lib/python3.7/site-packages/_pytest/config/__init__.py | gengyong/Carnets | 8930a14f69360d4db115a85ff9e0f6efa80fa2e7 | [
"BSD-3-Clause"
] | 31 | 2019-03-10T09:51:27.000Z | 2022-02-14T23:11:12.000Z | """ command line options, ini-file and conftest.py processing. """
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import copy
import inspect
import os
import shlex
import sys
import types
import warnings
import py
import six
from pkg_resour... | 34.690858 | 97 | 0.594914 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import copy
import inspect
import os
import shlex
import sys
import types
import warnings
import py
import six
from pkg_resources import parse_version
from pluggy import HookimplMarker
from plu... | true | true |
f70c9167149b0106f5be74ae34f60b2a00dc61dc | 45 | py | Python | tests/__init__.py | 9kin/codeforces-dl | 70edc1b8942f4a12ef052e0ae6e4331d34be6a71 | [
"MIT"
] | 5 | 2020-10-08T05:17:58.000Z | 2021-05-16T17:42:04.000Z | tests/__init__.py | 9kin/cfdl | 70edc1b8942f4a12ef052e0ae6e4331d34be6a71 | [
"MIT"
] | null | null | null | tests/__init__.py | 9kin/cfdl | 70edc1b8942f4a12ef052e0ae6e4331d34be6a71 | [
"MIT"
] | null | null | null | """Unit test package for codeforces2html."""
| 22.5 | 44 | 0.733333 | true | true | |
f70c9195412787b5affe6c6964b92b855e385044 | 16,268 | py | Python | btfxwss/connection.py | robertkarklinsh/btfxwss | c3520e1da3bda89f762f871c6069d37142491f67 | [
"MIT"
] | null | null | null | btfxwss/connection.py | robertkarklinsh/btfxwss | c3520e1da3bda89f762f871c6069d37142491f67 | [
"MIT"
] | null | null | null | btfxwss/connection.py | robertkarklinsh/btfxwss | c3520e1da3bda89f762f871c6069d37142491f67 | [
"MIT"
] | null | null | null | # Import Built-Ins
import logging
import json
import time
import ssl
import hashlib
import hmac
from multiprocessing import Queue
from threading import Thread, Event, Timer
from collections import OrderedDict
# Import Third-Party
import websocket
# Import Homebrew
# Init Logging Facilities
log = logging.getLogger(__... | 33.61157 | 98 | 0.57149 | import logging
import json
import time
import ssl
import hashlib
import hmac
from multiprocessing import Queue
from threading import Thread, Event, Timer
from collections import OrderedDict
import websocket
log = logging.getLogger(__name__)
class WebSocketConnection(Thread):
def __init__(self, *args, url=None,... | true | true |
f70c91cd387a0dc3aa4646a03addc469d8d04475 | 9,364 | py | Python | src/ripplenet_data_loader.py | andreeaiana/geneg_benchmarking | 0b53989c79b8e3771c144c0332fd36587dfe0f4d | [
"MIT"
] | 1 | 2021-12-08T12:02:56.000Z | 2021-12-08T12:02:56.000Z | src/ripplenet_data_loader.py | andreeaiana/geneg_benchmarking | 0b53989c79b8e3771c144c0332fd36587dfe0f4d | [
"MIT"
] | null | null | null | src/ripplenet_data_loader.py | andreeaiana/geneg_benchmarking | 0b53989c79b8e3771c144c0332fd36587dfe0f4d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# DISCLAIMER
# This code file is forked and adapted from https://github.com/tezignlab/RippleNet-TF2/blob/master/tools/load_data.py, which is under an MIT license.
""" Utilities for data loading for RippleNet. """
# import libraries
import os
import numpy as np
from collections import defaultd... | 41.617778 | 179 | 0.596967 |
import os
import numpy as np
from collections import defaultdict
from pathlib import Path
from typing import Dict, List, Tuple
from src.util.logger import setup_logging
from src.util.caching import create_cache, load_cache
from src.config import FILENAME_RATINGS_FINAL_TXT, FILENAME_RATINGS_FINAL_NPY, FILENAME_KG_FI... | true | true |
f70c9372d1e08c227c451f6995f0db4f740bf2b7 | 757 | py | Python | scripts/name_creator.py | ankitbhatia/word-mastermind | 51529b04e6e1bb150c867e0f6e44f36131c33189 | [
"MIT"
] | null | null | null | scripts/name_creator.py | ankitbhatia/word-mastermind | 51529b04e6e1bb150c867e0f6e44f36131c33189 | [
"MIT"
] | null | null | null | scripts/name_creator.py | ankitbhatia/word-mastermind | 51529b04e6e1bb150c867e0f6e44f36131c33189 | [
"MIT"
] | null | null | null | import csv
import glob
import pandas as pd
files = glob.glob("data/*.txt")
names = {}
for file in files:
with open(file) as csvfile:
reader = csv.reader(csvfile, delimiter=',')
for row in reader:
name = row[0]
sex = row[1]
number = row[2]
if name no... | 20.459459 | 51 | 0.483487 | import csv
import glob
import pandas as pd
files = glob.glob("data/*.txt")
names = {}
for file in files:
with open(file) as csvfile:
reader = csv.reader(csvfile, delimiter=',')
for row in reader:
name = row[0]
sex = row[1]
number = row[2]
if name no... | true | true |
f70c93d1e096e9a92827acda3d4d66f0256c4a0c | 3,117 | py | Python | segmentation_models_pytorch/losses/focal.py | themozel/segmentation_models_pytorch | 999c7c5cb77faa55793488db7a358ac9fe320b30 | [
"MIT"
] | 1 | 2021-07-24T11:57:45.000Z | 2021-07-24T11:57:45.000Z | segmentation_models_pytorch/losses/focal.py | wstchhwp/segmentation_models.pytorch | dcd19d676bdfbf73fc140d5b98d780f449b0a2f8 | [
"MIT"
] | null | null | null | segmentation_models_pytorch/losses/focal.py | wstchhwp/segmentation_models.pytorch | dcd19d676bdfbf73fc140d5b98d780f449b0a2f8 | [
"MIT"
] | null | null | null | from typing import Optional
from functools import partial
import torch
from torch.nn.modules.loss import _Loss
from ._functional import focal_loss_with_logits
from .constants import BINARY_MODE, MULTICLASS_MODE, MULTILABEL_MODE
__all__ = ["FocalLoss"]
class FocalLoss(_Loss):
def __init__(
self,
... | 34.252747 | 121 | 0.59769 | from typing import Optional
from functools import partial
import torch
from torch.nn.modules.loss import _Loss
from ._functional import focal_loss_with_logits
from .constants import BINARY_MODE, MULTICLASS_MODE, MULTILABEL_MODE
__all__ = ["FocalLoss"]
class FocalLoss(_Loss):
def __init__(
self,
... | true | true |
f70c9446510fd3a913edf73e84b550857396d62e | 153 | py | Python | src/process/infrastructure/cqrs/CommandQueryBase.py | PythonDataIntegrator/pythondataintegrator | 6167778c36c2295e36199ac0d4d256a4a0c28d7a | [
"MIT"
] | 14 | 2020-12-19T15:06:13.000Z | 2022-01-12T19:52:17.000Z | src/api/infrastructure/cqrs/CommandQueryBase.py | PythonDataIntegrator/pythondataintegrator | 6167778c36c2295e36199ac0d4d256a4a0c28d7a | [
"MIT"
] | 43 | 2021-01-06T22:05:22.000Z | 2022-03-10T10:30:30.000Z | src/process/infrastructure/cqrs/CommandQueryBase.py | PythonDataIntegrator/pythondataintegrator | 6167778c36c2295e36199ac0d4d256a4a0c28d7a | [
"MIT"
] | 4 | 2020-12-18T23:10:09.000Z | 2021-04-02T13:03:12.000Z | from typing import Generic, TypeVar
CQ = TypeVar('CQ', covariant=True)
class CommandQueryBase(Generic[CQ]):
def __init__(self) -> CQ:
pass | 19.125 | 36 | 0.686275 | from typing import Generic, TypeVar
CQ = TypeVar('CQ', covariant=True)
class CommandQueryBase(Generic[CQ]):
def __init__(self) -> CQ:
pass | true | true |
f70c95990672c947172bdd2639482942d6a67997 | 7,096 | py | Python | py/kubeflow/testing/go-license-tools/get_github_repo.py | ChanYiLin/testing | fab6c2782d18c3439b2699df7d1d7da154393e06 | [
"Apache-2.0"
] | null | null | null | py/kubeflow/testing/go-license-tools/get_github_repo.py | ChanYiLin/testing | fab6c2782d18c3439b2699df7d1d7da154393e06 | [
"Apache-2.0"
] | 451 | 2021-01-22T12:27:17.000Z | 2022-03-30T02:08:22.000Z | py/kubeflow/testing/go-license-tools/get_github_repo.py | ChanYiLin/testing | fab6c2782d18c3439b2699df7d1d7da154393e06 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 33.471698 | 97 | 0.681229 |
import argparse
import requests
import sys
import traceback
from bs4 import BeautifulSoup as Soup
parser = argparse.ArgumentParser(
description='Get github repo from go import path.')
parser.add_argument(
'go_dependency_list_file',
nargs='?',
default='dep.txt',
help=
'File path of a golang dependency list... | true | true |
f70c971c7ebd42d8e73a05dcfba1ec8f9432a06c | 342 | py | Python | tests/modeltests/model_package/models/article.py | kix/django | 5262a288df07daa050a0e17669c3f103f47a8640 | [
"BSD-3-Clause"
] | 790 | 2015-01-03T02:13:39.000Z | 2020-05-10T19:53:57.000Z | AppServer/lib/django-1.5/tests/modeltests/model_package/models/article.py | nlake44/appscale | 6944af660ca4cb772c9b6c2332ab28e5ef4d849f | [
"Apache-2.0"
] | 1,361 | 2015-01-08T23:09:40.000Z | 2020-04-14T00:03:04.000Z | AppServer/lib/django-1.5/tests/modeltests/model_package/models/article.py | nlake44/appscale | 6944af660ca4cb772c9b6c2332ab28e5ef4d849f | [
"Apache-2.0"
] | 155 | 2015-01-08T22:59:31.000Z | 2020-04-08T08:01:53.000Z | from django.contrib.sites.models import Site
from django.db import models
class Article(models.Model):
sites = models.ManyToManyField(Site)
headline = models.CharField(max_length=100)
publications = models.ManyToManyField("model_package.Publication", null=True, blank=True,)
class Meta:
app_la... | 28.5 | 94 | 0.748538 | from django.contrib.sites.models import Site
from django.db import models
class Article(models.Model):
sites = models.ManyToManyField(Site)
headline = models.CharField(max_length=100)
publications = models.ManyToManyField("model_package.Publication", null=True, blank=True,)
class Meta:
app_la... | true | true |
f70c9769bada922ea3842bb81a05492d1121bf42 | 5,473 | py | Python | data_utils/ModelNetDataLoader.py | ChambinLee/Pointnet_Pointnet2_pytorch | c5612493ce3bbdbb18a65eefc0dc8d90e09da74d | [
"MIT"
] | null | null | null | data_utils/ModelNetDataLoader.py | ChambinLee/Pointnet_Pointnet2_pytorch | c5612493ce3bbdbb18a65eefc0dc8d90e09da74d | [
"MIT"
] | null | null | null | data_utils/ModelNetDataLoader.py | ChambinLee/Pointnet_Pointnet2_pytorch | c5612493ce3bbdbb18a65eefc0dc8d90e09da74d | [
"MIT"
] | null | null | null | '''
@author: Xu Yan
@file: ModelNet.py
@time: 2021/3/19 15:51
'''
import os
import numpy as np
import warnings
import pickle
from tqdm import tqdm
from torch.utils.data import Dataset
warnings.filterwarnings('ignore')
def pc_normalize(pc):
centroid = np.mean(pc, axis=0)
pc = pc - centroid
m = np.max(np.... | 37.231293 | 121 | 0.589439 | import os
import numpy as np
import warnings
import pickle
from tqdm import tqdm
from torch.utils.data import Dataset
warnings.filterwarnings('ignore')
def pc_normalize(pc):
centroid = np.mean(pc, axis=0)
pc = pc - centroid
m = np.max(np.sqrt(np.sum(pc**2, axis=1)))
pc = pc / m
return pc
def f... | true | true |
f70c9783b5eed76f371de2f83af0f6dff88d380d | 1,241 | py | Python | gufunc_sampler/examples.py | jaimefrio/gufunc_sampler | 931eb0de5c3ac3f8f49d27e63c655505193d762d | [
"Unlicense"
] | 5 | 2016-04-14T05:23:40.000Z | 2019-01-21T22:31:50.000Z | gufunc_sampler/examples.py | jaimefrio/gufunc_sampler | 931eb0de5c3ac3f8f49d27e63c655505193d762d | [
"Unlicense"
] | null | null | null | gufunc_sampler/examples.py | jaimefrio/gufunc_sampler | 931eb0de5c3ac3f8f49d27e63c655505193d762d | [
"Unlicense"
] | null | null | null | from __future__ import division
import numpy as np
import matplotlib.pyplot as plt
import gufunc_sampler as gs
# Mandelbrot set
rows = np.linspace(-1.25, 1.25, 1250)
cols = np.linspace(-2, 0.5, 1250)
mandel_set = gs.mandelbrot(cols + 1.j * rows[:, np.newaxis], 50)
plt.subplot(121)
plt.imshow(mandel_set, ... | 45.962963 | 386 | 0.44722 | from __future__ import division
import numpy as np
import matplotlib.pyplot as plt
import gufunc_sampler as gs
rows = np.linspace(-1.25, 1.25, 1250)
cols = np.linspace(-2, 0.5, 1250)
mandel_set = gs.mandelbrot(cols + 1.j * rows[:, np.newaxis], 50)
plt.subplot(121)
plt.imshow(mandel_set, interpolation='nea... | false | true |
f70c9894e512e0874e335bee06c8ffd923e1e83d | 1,400 | py | Python | cfgov/sheerlike/management/commands/sheer_index.py | atuggle/cfgov-refresh | 5a9cfd92b460b9be7befb39f5845abf56857aeac | [
"CC0-1.0"
] | null | null | null | cfgov/sheerlike/management/commands/sheer_index.py | atuggle/cfgov-refresh | 5a9cfd92b460b9be7befb39f5845abf56857aeac | [
"CC0-1.0"
] | null | null | null | cfgov/sheerlike/management/commands/sheer_index.py | atuggle/cfgov-refresh | 5a9cfd92b460b9be7befb39f5845abf56857aeac | [
"CC0-1.0"
] | null | null | null | import os.path
from django.conf import settings
from django.core.management.base import BaseCommand
from sheerlike.indexer import index
LOCATION = os.environ.get('SHEER_LOCATION', os.getcwd())
ELASTICSEARCH_HOSTS = settings.SHEER_ELASTICSEARCH_SERVER
ELASTICSEARCH_INDEX = settings.SHEER_ELASTICSEARCH_INDEX
class ... | 35 | 79 | 0.621429 | import os.path
from django.conf import settings
from django.core.management.base import BaseCommand
from sheerlike.indexer import index
LOCATION = os.environ.get('SHEER_LOCATION', os.getcwd())
ELASTICSEARCH_HOSTS = settings.SHEER_ELASTICSEARCH_SERVER
ELASTICSEARCH_INDEX = settings.SHEER_ELASTICSEARCH_INDEX
class ... | true | true |
f70c9a155e354e16ba75b8f392baa5c978202f18 | 2,369 | py | Python | mozetl/system_check.py | willkg/python_mozetl | 946fbd50f4c593fabe6b7ff33982c07c52c3d3de | [
"MIT"
] | 28 | 2017-05-01T20:06:19.000Z | 2021-11-14T19:41:51.000Z | mozetl/system_check.py | willkg/python_mozetl | 946fbd50f4c593fabe6b7ff33982c07c52c3d3de | [
"MIT"
] | 302 | 2017-04-25T17:59:54.000Z | 2022-03-24T13:19:34.000Z | mozetl/system_check.py | willkg/python_mozetl | 946fbd50f4c593fabe6b7ff33982c07c52c3d3de | [
"MIT"
] | 36 | 2017-04-25T18:31:37.000Z | 2022-01-25T02:05:20.000Z | """"A system check for testing integration of various libraries with mozetl.
This sub-module will print out relevant version info. It will also read data
from `main_summary` and print basic statistics to verify that the system is
correctly set-up.
"""
import sys
import click
import logging
from datetime import datet... | 32.452055 | 97 | 0.688476 |
import sys
import click
import logging
from datetime import datetime, timedelta
from pyspark.sql import SparkSession
from mozetl.utils import (
format_as_submission_date,
format_spark_path,
stop_session_safely,
)
logging.basicConfig(level=logging.DEBUG)
@click.command()
@click.option("--local/--no-loc... | true | true |
f70c9b165f9aa9483be6ebcddaeaa2406a850498 | 76 | py | Python | tests/basic.py | brightway-lca/brightway_projects | ccd5036620c505c700cf59aafaaa3533dbdd52a4 | [
"BSD-3-Clause"
] | 4 | 2017-05-23T14:28:05.000Z | 2018-08-17T14:16:11.000Z | tests/basic.py | brightway-lca/bw_projects | ccd5036620c505c700cf59aafaaa3533dbdd52a4 | [
"BSD-3-Clause"
] | 3 | 2019-10-12T07:37:45.000Z | 2019-10-18T19:27:24.000Z | tests/basic.py | brightway-lca/brightway_projects | ccd5036620c505c700cf59aafaaa3533dbdd52a4 | [
"BSD-3-Clause"
] | null | null | null | import bw_projects
def test_version():
assert bw_projects.__version__
| 12.666667 | 34 | 0.789474 | import bw_projects
def test_version():
assert bw_projects.__version__
| true | true |
f70c9b1ceaed7c0cdb056b7c3c833ba209885285 | 260 | py | Python | {{cookiecutter.project_name}}/{{cookiecutter.project_name}}/config/.env_file.py | vioquedu/django-redux-boilerplate | f63d7a99d825215ea4d5e2eb41bb6fc1be491718 | [
"BSD-3-Clause"
] | 5 | 2016-07-21T23:54:20.000Z | 2017-07-26T20:36:25.000Z | {{cookiecutter.project_name}}/{{cookiecutter.project_name}}/config/.env_file.py | vioquedu/django-redux-boilerplate | f63d7a99d825215ea4d5e2eb41bb6fc1be491718 | [
"BSD-3-Clause"
] | 5 | 2016-10-22T20:08:06.000Z | 2017-01-12T13:01:42.000Z | {{cookiecutter.project_name}}/{{cookiecutter.project_name}}/config/.env_file.py | vioquedu/django-redux-boilerplate | f63d7a99d825215ea4d5e2eb41bb6fc1be491718 | [
"BSD-3-Clause"
] | null | null | null | DEBUG=on
SECRET_KEY=CHANGE_ME!!!!
ALLOWED_HOSTS=,
DATABASE_URL=postgres://{{cookiecutter.db_user}}:{{cookiecutter.db_pwd}}@db/{{cookiecutter.db_name}}
EMAIL_HOST_USER={{cookiecutter.author_email}}
EMAIL_PWD=email_pwd
EMAIL_ADMIN={{cookiecutter.author_email}}
| 32.5 | 100 | 0.803846 | DEBUG=on
SECRET_KEY=CHANGE_ME!!!!
ALLOWED_HOSTS=,
DATABASE_URL=postgres://{{cookiecutter.db_user}}:{{cookiecutter.db_pwd}}@db/{{cookiecutter.db_name}}
EMAIL_HOST_USER={{cookiecutter.author_email}}
EMAIL_PWD=email_pwd
EMAIL_ADMIN={{cookiecutter.author_email}}
| false | true |
f70c9c710e197f63a9f68c52b505b8836ff9453d | 3,674 | py | Python | server/user/models.py | openml/openml.org | dadc4f79c159058776500b204977a1062b927d4c | [
"BSD-3-Clause"
] | 16 | 2018-10-17T19:35:11.000Z | 2022-03-31T23:37:00.000Z | server/user/models.py | PortML/openml.org | b526fae6c0ba2df0ccebf60f1dd703368ed394ec | [
"BSD-3-Clause"
] | 192 | 2018-10-17T17:31:03.000Z | 2022-03-27T23:55:51.000Z | server/user/models.py | PortML/openml.org | b526fae6c0ba2df0ccebf60f1dd703368ed394ec | [
"BSD-3-Clause"
] | 8 | 2019-04-15T11:47:32.000Z | 2021-12-15T13:23:54.000Z | import datetime
# from sqlalchemy import Column, Integer, String
import hashlib
from server.extensions import Base, argon2, bcrypt
class User(Base):
__table__ = Base.metadata.tables["users"]
__table_args__ = {"autoload": True}
# Attribute names to help out with functions
# id = Column(Integer, prim... | 32.513274 | 81 | 0.655144 | import datetime
import hashlib
from server.extensions import Base, argon2, bcrypt
class User(Base):
__table__ = Base.metadata.tables["users"]
__table_args__ = {"autoload": True}
def set_pass... | true | true |
f70c9ce834362406e19b54ddfbde6250f8533c79 | 6,389 | py | Python | gcloud/tests/taskflow3/models/taskflow/test_get_node_detail.py | brookylin/bk-sops | 6c0cf78879849921c4ff6ad6bf3bb82dfdf5b973 | [
"Apache-2.0"
] | 881 | 2019-03-25T02:45:42.000Z | 2022-03-30T09:10:49.000Z | gcloud/tests/taskflow3/models/taskflow/test_get_node_detail.py | m0re-work/bk-sops | d03ba8a4ee0781c6daaf0dd38a7369dc82669f7d | [
"Apache-2.0"
] | 3,303 | 2019-03-25T04:18:03.000Z | 2022-03-31T11:52:03.000Z | gcloud/tests/taskflow3/models/taskflow/test_get_node_detail.py | m0re-work/bk-sops | d03ba8a4ee0781c6daaf0dd38a7369dc82669f7d | [
"Apache-2.0"
] | 395 | 2019-03-25T02:53:36.000Z | 2022-03-31T08:37:28.000Z | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | 42.032895 | 115 | 0.673971 |
from django.test import TestCase
from gcloud import err_code
from gcloud.taskflow3.models import TaskFlowInstance
from gcloud.tests.mock import * from gcloud.tests.mock_settings import *
class GetNodeDetailTestCase(TestCase):
def test_node_does_not_exist(self):
taskflow = TaskFlowInstance()
t... | true | true |
f70c9d011edd06801fbe1eb5c620a18f842e46d5 | 996 | py | Python | vlcplayer.py | danlyke/squareplay | 30783579c3e4dc9a61890b78102fa4020f80c6aa | [
"MIT"
] | null | null | null | vlcplayer.py | danlyke/squareplay | 30783579c3e4dc9a61890b78102fa4020f80c6aa | [
"MIT"
] | null | null | null | vlcplayer.py | danlyke/squareplay | 30783579c3e4dc9a61890b78102fa4020f80c6aa | [
"MIT"
] | null | null | null | import vlc
instance = vlc.Instance()
class VLCPlayer:
def __init__(self):
self.player = instance.media_player_new()
self.player.audio_output_set("Scaletempo")
self.length = 0
def set_position(self,position) :
self.player.set_position(position / self.get_length())
... | 23.714286 | 62 | 0.621486 | import vlc
instance = vlc.Instance()
class VLCPlayer:
def __init__(self):
self.player = instance.media_player_new()
self.player.audio_output_set("Scaletempo")
self.length = 0
def set_position(self,position) :
self.player.set_position(position / self.get_length())
... | true | true |
f70c9d3e13ab3ff94667a701c7583af139e37534 | 894 | py | Python | eunice012716/Week2/ch4/4.3/exercise2.py | txya900619/Intern-Training | 76cac20ac988609f313765ebeb72d20da9dcc05e | [
"MIT"
] | 1 | 2021-08-24T12:14:46.000Z | 2021-08-24T12:14:46.000Z | eunice012716/Week2/ch4/4.3/exercise2.py | txya900619/Intern-Training | 76cac20ac988609f313765ebeb72d20da9dcc05e | [
"MIT"
] | 14 | 2021-07-09T07:48:35.000Z | 2021-08-19T03:06:31.000Z | eunice012716/Week2/ch4/4.3/exercise2.py | txya900619/Intern-Training | 76cac20ac988609f313765ebeb72d20da9dcc05e | [
"MIT"
] | 11 | 2021-07-09T07:35:24.000Z | 2021-08-15T07:19:43.000Z | import torch
from torch import nn
from d2l import torch as d2l
BATCH_SIZE, LR, NUM_EPOCHS = 256, 0.1, 10
ACTIVATE_FUNCS = [nn.ReLU(), nn.Sigmoid(), nn.Tanh()]
def init_weights(m):
if type(m) == nn.Linear:
nn.init.normal_(m.weight, std=0.01)
if __name__ == "__main__":
for i in range(0, 3):
n... | 27.9375 | 76 | 0.624161 | import torch
from torch import nn
from d2l import torch as d2l
BATCH_SIZE, LR, NUM_EPOCHS = 256, 0.1, 10
ACTIVATE_FUNCS = [nn.ReLU(), nn.Sigmoid(), nn.Tanh()]
def init_weights(m):
if type(m) == nn.Linear:
nn.init.normal_(m.weight, std=0.01)
if __name__ == "__main__":
for i in range(0, 3):
n... | true | true |
f70c9d66dcce1ce601c098649b1b6f89a1032d77 | 6,348 | py | Python | bot.py | DestinyofYeet/antonstechbot | b01372431a3a2b51fb83180cf8caa1a168e294ad | [
"MIT"
] | 1 | 2021-04-21T09:01:26.000Z | 2021-04-21T09:01:26.000Z | bot.py | DestinyofYeet/antonstechbot | b01372431a3a2b51fb83180cf8caa1a168e294ad | [
"MIT"
] | null | null | null | bot.py | DestinyofYeet/antonstechbot | b01372431a3a2b51fb83180cf8caa1a168e294ad | [
"MIT"
] | null | null | null | import asyncio
import json
import random
import subprocess
import discord
import discord.ext
import requests
from discord.ext import commands
import os
from botlibrary.utils import get_variable
from botlibrary import constants
# Wichs Codierung
# ä=ü
# ö=ö
# assign constant variables
constants.assignVariables()
V... | 35.071823 | 158 | 0.625709 | import asyncio
import json
import random
import subprocess
import discord
import discord.ext
import requests
from discord.ext import commands
import os
from botlibrary.utils import get_variable
from botlibrary import constants
constants.assignVariables()
VERSION = constants.VERSION
bot_prefix = constants.bot_prefi... | true | true |
f70c9dbaed52611996e0d139370df5a86dca6d9b | 485 | py | Python | dev/new_task.py | mccolm-robotics/Claver-Dispatch | 84ce0b4b65862c48c892759d66506be9990d4449 | [
"MIT"
] | null | null | null | dev/new_task.py | mccolm-robotics/Claver-Dispatch | 84ce0b4b65862c48c892759d66506be9990d4449 | [
"MIT"
] | null | null | null | dev/new_task.py | mccolm-robotics/Claver-Dispatch | 84ce0b4b65862c48c892759d66506be9990d4449 | [
"MIT"
] | null | null | null | import pika
import sys
connection = pika.BlockingConnection(
pika.ConnectionParameters(host='localhost'))
channel = connection.channel()
channel.queue_declare(queue='task_queue', durable=True)
message = ' '.join(sys.argv[1:]) or "Hello World!"
channel.basic_publish(
exchange='',
routing_key='task_queue',... | 25.526316 | 55 | 0.713402 | import pika
import sys
connection = pika.BlockingConnection(
pika.ConnectionParameters(host='localhost'))
channel = connection.channel()
channel.queue_declare(queue='task_queue', durable=True)
message = ' '.join(sys.argv[1:]) or "Hello World!"
channel.basic_publish(
exchange='',
routing_key='task_queue',... | true | true |
f70c9e3b50c4675c04919b64426f03ccededdeba | 118 | py | Python | zdevelop/tests/test_example.py | illuscio-dev/islelib-py | 6f4dd27233a7c38f112954673bb683c6790956fd | [
"MIT"
] | 1 | 2020-04-16T00:58:39.000Z | 2020-04-16T00:58:39.000Z | zdevelop/tests/test_example.py | illuscio-dev/islelib-py | 6f4dd27233a7c38f112954673bb683c6790956fd | [
"MIT"
] | null | null | null | zdevelop/tests/test_example.py | illuscio-dev/islelib-py | 6f4dd27233a7c38f112954673bb683c6790956fd | [
"MIT"
] | 1 | 2021-04-28T22:25:21.000Z | 2021-04-28T22:25:21.000Z | from islelib import __version__
def test_example(example_fixture: int) -> None:
assert __version__ is not False
| 19.666667 | 47 | 0.779661 | from islelib import __version__
def test_example(example_fixture: int) -> None:
assert __version__ is not False
| true | true |
f70c9efd4cf48afe372c5482d16a7c5c6f94e684 | 1,798 | py | Python | tests/paz/backend/processor.py | niqbal996/paz | f27205907367415d5b21f90e1a1d1d1ce598e889 | [
"MIT"
] | 300 | 2020-10-29T08:02:05.000Z | 2022-03-30T21:47:32.000Z | tests/paz/backend/processor.py | albertofernandezvillan/paz | 9fbd50b993f37e1e807297a29c6044c09967c9cc | [
"MIT"
] | 30 | 2020-10-29T12:40:32.000Z | 2022-03-31T14:06:35.000Z | tests/paz/backend/processor.py | albertofernandezvillan/paz | 9fbd50b993f37e1e807297a29c6044c09967c9cc | [
"MIT"
] | 62 | 2020-10-29T12:34:13.000Z | 2022-03-29T05:21:45.000Z | from paz.core import Processor
from paz.core import SequentialProcessor
import numpy as np
class ProcessorA(Processor):
def __init__(self):
super(ProcessorA, self).__init__()
def call(self, image, boxes):
boxes = boxes - 1.0
return image, boxes
class ProcessorB(Processor):
def _... | 24.297297 | 59 | 0.674638 | from paz.core import Processor
from paz.core import SequentialProcessor
import numpy as np
class ProcessorA(Processor):
def __init__(self):
super(ProcessorA, self).__init__()
def call(self, image, boxes):
boxes = boxes - 1.0
return image, boxes
class ProcessorB(Processor):
def _... | true | true |
f70c9fc4d2ad877ebca3e0fda9dbe2a471a56fe1 | 3,642 | py | Python | 5.2_CUSTOM_LIBRARY/model_analyzer.py | pedroMoya/M5_kaggle_uncertainty_share | f1dea9af9ec2e29e9bccb21d9b6e3627dff14c6e | [
"MIT"
] | null | null | null | 5.2_CUSTOM_LIBRARY/model_analyzer.py | pedroMoya/M5_kaggle_uncertainty_share | f1dea9af9ec2e29e9bccb21d9b6e3627dff14c6e | [
"MIT"
] | null | null | null | 5.2_CUSTOM_LIBRARY/model_analyzer.py | pedroMoya/M5_kaggle_uncertainty_share | f1dea9af9ec2e29e9bccb21d9b6e3627dff14c6e | [
"MIT"
] | null | null | null | # Model architecture analyzer
import os
import logging
import logging.handlers as handlers
import json
import numpy as np
import tensorflow as tf
physical_devices = tf.config.list_physical_devices('GPU')
tf.config.experimental.set_memory_growth(physical_devices[0], enable=True)
tf.keras.backend.set_floatx('float32')
fr... | 47.921053 | 119 | 0.704009 | import os
import logging
import logging.handlers as handlers
import json
import numpy as np
import tensorflow as tf
physical_devices = tf.config.list_physical_devices('GPU')
tf.config.experimental.set_memory_growth(physical_devices[0], enable=True)
tf.keras.backend.set_floatx('float32')
from tensorflow.keras import lay... | true | true |
f70ca09d28978c7b179ba1d709eabf61d6294994 | 1,670 | py | Python | panoptes/webapp/config.py | lesingerouge/Panoptes | 4be798b31f659694b83533f8df520d674756afd7 | [
"MIT"
] | null | null | null | panoptes/webapp/config.py | lesingerouge/Panoptes | 4be798b31f659694b83533f8df520d674756afd7 | [
"MIT"
] | null | null | null | panoptes/webapp/config.py | lesingerouge/Panoptes | 4be798b31f659694b83533f8df520d674756afd7 | [
"MIT"
] | null | null | null | # system imports
import os, json
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
"""
Class used to hold configurations that are used in both website and admin applications
"""
MONGO_HOST = "localhost"
MONGO_DBNAME = "panoptes"
THREADS_PER_PAGE = 8
mailcfg = json.loa... | 22.876712 | 151 | 0.658084 | import os, json
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
MONGO_HOST = "localhost"
MONGO_DBNAME = "panoptes"
THREADS_PER_PAGE = 8
mailcfg = json.load(open('mailcfg.json'))
MAIL_SERVER = mailcfg['MAIL_SERVER']
MAIL_PORT = mailcfg['MAIL_PORT']
MAIL_USE_TLS = mai... | true | true |
f70ca13496a84f896b25dd21e28f513253f96a73 | 1,375 | py | Python | base-LASED/LASED/.ipynb_checkpoints/detuning-checkpoint.py | mvpmanish/LASED | 7793037b3e77ee9205f631d7ff6c511895108400 | [
"MIT"
] | 7 | 2021-06-07T14:58:01.000Z | 2022-03-24T18:08:13.000Z | base-LASED/build/lib/LASED/detuning.py | mvpmanish/LASED | 7793037b3e77ee9205f631d7ff6c511895108400 | [
"MIT"
] | 13 | 2021-06-07T14:15:54.000Z | 2022-03-29T11:06:10.000Z | base-LASED/LASED/detuning.py | mvpmanish/LASED | 7793037b3e77ee9205f631d7ff6c511895108400 | [
"MIT"
] | 2 | 2021-12-09T06:31:23.000Z | 2022-03-18T17:29:48.000Z | '''
Define functions for the detuning of an atomic system
'''
from LASED.state import *
from LASED.constants import *
def delta(e, g):
"""Detunings between substates.
Parameters:
e (State): State object
g (State): State object
Returns:
float: Difference in angular freque... | 29.891304 | 124 | 0.647273 | from LASED.state import *
from LASED.constants import *
def delta(e, g):
return e.w - g.w
def angularFreq(wavelength):
return 2*PI*C/wavelength*1e-9
def dopplerDelta(e, g, w_q, lambda_q, v_z):
return w_q - v_z/lambda_q - e.w + g.w | true | true |
f70ca15d9c4d2723eb2b39fff7fab7a631832be1 | 1,602 | py | Python | desktop/core/ext-py/lxml/benchmark/bench_xslt.py | t3hi3x/hue | 36d71c1a8dd978b899ef2dc3eef8887b68fd99a8 | [
"Apache-2.0"
] | 19 | 2015-05-01T19:59:03.000Z | 2021-12-09T08:03:16.000Z | desktop/core/ext-py/lxml/benchmark/bench_xslt.py | t3hi3x/hue | 36d71c1a8dd978b899ef2dc3eef8887b68fd99a8 | [
"Apache-2.0"
] | 1 | 2018-01-03T15:26:49.000Z | 2018-01-03T15:26:49.000Z | desktop/core/ext-py/lxml/benchmark/bench_xslt.py | t3hi3x/hue | 36d71c1a8dd978b899ef2dc3eef8887b68fd99a8 | [
"Apache-2.0"
] | 30 | 2015-03-25T19:40:07.000Z | 2021-05-28T22:59:26.000Z | import sys, copy
from itertools import *
from StringIO import StringIO
import benchbase
from benchbase import with_attributes, with_text, onlylib, serialized
############################################################
# Benchmarks
############################################################
class XSLTBenchMark(benc... | 27.152542 | 76 | 0.574282 | import sys, copy
from itertools import *
from StringIO import StringIO
import benchbase
from benchbase import with_attributes, with_text, onlylib, serialized
class XSLTBenchMark(benchbase.TreeBenchMark):
@onlylib('lxe')
def bench_xslt_extensions_old(self, root):
tree = self.etree.XML("""\
<xsl:styles... | true | true |
f70ca2e741a791f661c4c075fecb809c2656b213 | 28,177 | py | Python | unifac/database.py | JacekPrzemieniecki/UNIFAC | c32702aeffd695a9fd3883cf150500e902df7a97 | [
"MIT"
] | 6 | 2016-01-04T02:33:13.000Z | 2021-07-18T08:32:51.000Z | unifac/database.py | JacekPrzemieniecki/UNIFAC | c32702aeffd695a9fd3883cf150500e902df7a97 | [
"MIT"
] | 1 | 2020-07-27T17:56:23.000Z | 2020-08-10T06:30:06.000Z | unifac/database.py | JacekPrzemieniecki/UNIFAC | c32702aeffd695a9fd3883cf150500e902df7a97 | [
"MIT"
] | 6 | 2015-01-02T19:18:16.000Z | 2021-04-16T08:12:14.000Z | '''
Created on 08-10-2012
@author: Jacek Przemieniecki
'''
from . import errors
class Database(object):
def get_atom_valency(self, symbol):
return valency[symbol]
def get_q_r(self, symbol):
grp_id = str_to_id[symbol][0]
return q_r_data[grp_id]
def get_parameter(self,... | 80.048295 | 419 | 0.555559 | from . import errors
class Database(object):
def get_atom_valency(self, symbol):
return valency[symbol]
def get_q_r(self, symbol):
grp_id = str_to_id[symbol][0]
return q_r_data[grp_id]
def get_parameter(self, symbol1, symbol2):
if symbol1 == symbol2:
... | true | true |
f70ca4380e2d991139e16da6ddfa214ad0a9934f | 9,327 | py | Python | config/efficientnet/efficientnet_b5_fpn_bn_scratch_400_6x.py | tingyumao94/groupsoftmax-simpledet | feda05ae2261efcbd0e298792cd66dd383b1bdf6 | [
"Apache-2.0"
] | 153 | 2019-08-26T06:39:32.000Z | 2022-02-17T03:51:23.000Z | config/efficientnet/efficientnet_b5_fpn_bn_scratch_400_6x.py | tingyumao94/groupsoftmax-simpledet | feda05ae2261efcbd0e298792cd66dd383b1bdf6 | [
"Apache-2.0"
] | 4 | 2019-09-11T09:49:04.000Z | 2020-03-04T07:31:42.000Z | config/efficientnet/efficientnet_b5_fpn_bn_scratch_400_6x.py | tingyumao94/groupsoftmax-simpledet | feda05ae2261efcbd0e298792cd66dd383b1bdf6 | [
"Apache-2.0"
] | 26 | 2019-08-27T13:29:18.000Z | 2022-02-09T01:42:25.000Z | from symbol.builder import FasterRcnn as Detector
from symbol.builder import add_anchor_to_arg
from models.efficientnet.builder import EfficientNetB5FPN as Backbone
from models.FPN.builder import FPNNeck as Neck
from models.FPN.builder import FPNRpnHead as RpnHead
from models.FPN.builder import FPNRoiAlign as RoiExtrac... | 29.703822 | 100 | 0.57221 | from symbol.builder import FasterRcnn as Detector
from symbol.builder import add_anchor_to_arg
from models.efficientnet.builder import EfficientNetB5FPN as Backbone
from models.FPN.builder import FPNNeck as Neck
from models.FPN.builder import FPNRpnHead as RpnHead
from models.FPN.builder import FPNRoiAlign as RoiExtrac... | true | true |
f70ca4df4d8693543185eb6be9555a14f6817889 | 463 | py | Python | flask/server.py | graykode/kubernetes-glusterfs-aws | b377f731c7e732a1d0c4d64fb067b6ed602a6761 | [
"MIT"
] | 15 | 2019-04-02T09:20:25.000Z | 2020-02-15T06:54:23.000Z | flask/server.py | graykode/kubernetes-glusterfs-aws | b377f731c7e732a1d0c4d64fb067b6ed602a6761 | [
"MIT"
] | null | null | null | flask/server.py | graykode/kubernetes-glusterfs-aws | b377f731c7e732a1d0c4d64fb067b6ed602a6761 | [
"MIT"
] | 4 | 2019-04-03T06:44:59.000Z | 2021-08-04T07:39:56.000Z | #!/usr/bin/env python3
from flask import Flask, render_template, request
from werkzeug import secure_filename
app = Flask(__name__)
@app.route('/')
def index():
return render_template('index.html')
@app.route('/upload', methods=['POST'])
def upload():
if request.method == 'POST':
f = request.files.get... | 24.368421 | 49 | 0.663067 | from flask import Flask, render_template, request
from werkzeug import secure_filename
app = Flask(__name__)
@app.route('/')
def index():
return render_template('index.html')
@app.route('/upload', methods=['POST'])
def upload():
if request.method == 'POST':
f = request.files.get('file')
fname ... | true | true |
f70ca51b7c3abc91b467439c4e0dab5b31d3f255 | 995 | py | Python | lanthanum/widgets.py | kingstonlabs/django-lanthanum | 726f714ecd874a9a598d3e12d113a62f24832514 | [
"BSD-3-Clause"
] | null | null | null | lanthanum/widgets.py | kingstonlabs/django-lanthanum | 726f714ecd874a9a598d3e12d113a62f24832514 | [
"BSD-3-Clause"
] | null | null | null | lanthanum/widgets.py | kingstonlabs/django-lanthanum | 726f714ecd874a9a598d3e12d113a62f24832514 | [
"BSD-3-Clause"
] | null | null | null | import copy
import json
from django_admin_json_editor import JSONEditorWidget
from django.utils.safestring import mark_safe
from django.template.loader import render_to_string
class JSONEditorWidget(JSONEditorWidget):
template_name = 'lanthanum/_json_editor_widget.html'
def render(self, name, value, attrs=N... | 30.151515 | 78 | 0.643216 | import copy
import json
from django_admin_json_editor import JSONEditorWidget
from django.utils.safestring import mark_safe
from django.template.loader import render_to_string
class JSONEditorWidget(JSONEditorWidget):
template_name = 'lanthanum/_json_editor_widget.html'
def render(self, name, value, attrs=N... | true | true |
f70ca6efda6e90267dd0303b0c44eddd0534c01e | 3,750 | py | Python | test/acceptance/integration/environments/get_environment_details/steps.py | hmunfru/fiware-paas | dd808e986f5463dcbb85370b295404f167838ea1 | [
"Apache-2.0"
] | null | null | null | test/acceptance/integration/environments/get_environment_details/steps.py | hmunfru/fiware-paas | dd808e986f5463dcbb85370b295404f167838ea1 | [
"Apache-2.0"
] | null | null | null | test/acceptance/integration/environments/get_environment_details/steps.py | hmunfru/fiware-paas | dd808e986f5463dcbb85370b295404f167838ea1 | [
"Apache-2.0"
] | 2 | 2016-08-22T16:03:25.000Z | 2018-03-05T23:28:55.000Z | # -*- coding: utf-8 -*-
# Copyright 2014 Telefonica Investigación y Desarrollo, S.A.U
#
# This file is part of FI-WARE project.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
#
# You may obtain a copy of the License at:
#
# h... | 39.893617 | 90 | 0.7672 |
from lettuce import step, world
from lettuce_tools.dataset_utils.dataset_utils import DatasetUtils
from tools import http
from tools import environment_request
from tools.tier import Tier
from tools.constants import NAME, DESCRIPTION, PRODUCTS, NETWORKS, PAAS,\
TIER_IMAGE
dataset_utils = DatasetUtils()
@step(u'... | true | true |
f70ca702e765b72d170cd703e3c1c68745be1103 | 453 | py | Python | setup.py | sanyatuning/home-assistant-polymer | cc301df57d7249d0cb97a7617880fad27a37d35f | [
"Apache-2.0"
] | null | null | null | setup.py | sanyatuning/home-assistant-polymer | cc301df57d7249d0cb97a7617880fad27a37d35f | [
"Apache-2.0"
] | null | null | null | setup.py | sanyatuning/home-assistant-polymer | cc301df57d7249d0cb97a7617880fad27a37d35f | [
"Apache-2.0"
] | null | null | null | from setuptools import setup, find_packages
setup(
name="home-assistant-frontend",
version="20211215.0",
description="The Home Assistant frontend",
url="https://github.com/home-assistant/frontend",
author="The Home Assistant Authors",
author_email="hello@home-assistant.io",
license="Apache-... | 30.2 | 73 | 0.715232 | from setuptools import setup, find_packages
setup(
name="home-assistant-frontend",
version="20211215.0",
description="The Home Assistant frontend",
url="https://github.com/home-assistant/frontend",
author="The Home Assistant Authors",
author_email="hello@home-assistant.io",
license="Apache-... | true | true |
f70ca7ed9abc143ee5dbd4df547f5da8a385c7ba | 12,169 | py | Python | synthtool/gcp/gapic_bazel.py | arithmetic1728/synthtool | d022f14edf182e1653a5832cf6d29365f503b26c | [
"Apache-2.0"
] | null | null | null | synthtool/gcp/gapic_bazel.py | arithmetic1728/synthtool | d022f14edf182e1653a5832cf6d29365f503b26c | [
"Apache-2.0"
] | null | null | null | synthtool/gcp/gapic_bazel.py | arithmetic1728/synthtool | d022f14edf182e1653a5832cf6d29365f503b26c | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 39.767974 | 118 | 0.608513 | from pathlib import Path
from typing import Optional, Union
import os
import shutil
import tempfile
from synthtool import _tracked_paths, metadata, shell
from synthtool.log import logger
from synthtool.sources import git
GOOGLEAPIS_URL: str = git.make_repo_clone_url("googleapis/googleapis")
GOOGLEAPIS_PRIVATE_URL: st... | true | true |
f70ca8667ffe97f1e7850ad20dea532cf5ffb1c1 | 1,197 | py | Python | tests/test_easyipc.py | luiscarlosgph/easyipc | befe03bd2d1bf9f8378bcdf391dbeac8576bd723 | [
"MIT"
] | 1 | 2020-09-15T13:04:16.000Z | 2020-09-15T13:04:16.000Z | tests/test_easyipc.py | luiscarlosgph/easyipc | befe03bd2d1bf9f8378bcdf391dbeac8576bd723 | [
"MIT"
] | null | null | null | tests/test_easyipc.py | luiscarlosgph/easyipc | befe03bd2d1bf9f8378bcdf391dbeac8576bd723 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @brief This module has unit tests for the classes of EasyIPC.
# @author Luis C. Garcia-Peraza Herrera (luiscarlos.gph@gmail.com).
# @date 25 June 2020.
import unittest
import os
import sys
import numpy as np
# My imports
import easyipc
class TestEasyIPC(unittest.Tes... | 28.5 | 67 | 0.567251 |
import unittest
import os
import sys
import numpy as np
import easyipc
class TestEasyIPC(unittest.TestCase):
def test_pipe(self):
data = [np.random.rand(1000, 1000) for i in range(100)]
newpid = os.fork()
if newpid == 0:
client = easyipc.Pipe('hoho')
client.co... | true | true |
f70ca9f3889ccc3449eca2d8d12d6c708481874c | 6,474 | py | Python | tensorflow_model_optimization/python/core/common/keras/compression/algorithm.py | arovir01/model-optimization | 92bfb45da34715eeff8849c2007cf3b734429120 | [
"Apache-2.0"
] | 1,318 | 2018-10-31T23:57:52.000Z | 2022-03-30T11:07:40.000Z | tensorflow_model_optimization/python/core/common/keras/compression/algorithm.py | arovir01/model-optimization | 92bfb45da34715eeff8849c2007cf3b734429120 | [
"Apache-2.0"
] | 410 | 2019-05-15T14:11:13.000Z | 2022-03-31T07:27:07.000Z | tensorflow_model_optimization/python/core/common/keras/compression/algorithm.py | arovir01/model-optimization | 92bfb45da34715eeff8849c2007cf3b734429120 | [
"Apache-2.0"
] | 290 | 2019-05-14T17:42:49.000Z | 2022-03-28T02:21:45.000Z | # Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 34.620321 | 96 | 0.718103 | import abc
from typing import List, Any
import dataclasses
import tensorflow as tf
from tensorflow_model_optimization.python.core.common.keras.compression.internal import optimize
@dataclasses.dataclass
class WeightRepr:
args: Any = None
kwargs: Any = None
class WeightCompressor(metaclass=abc.ABCMeta):
upda... | true | true |
f70caa3fbef0f01fbdcda9de53ac6b5e5a0d5873 | 2,670 | py | Python | causalicp/test/tests_icp.py | juangamella/icp | 80548610a13b6b76515f46f56e0f7f486cf9c1c7 | [
"BSD-3-Clause"
] | 7 | 2021-07-20T07:25:32.000Z | 2022-03-09T09:01:39.000Z | causalicp/test/tests_icp.py | juangamella/icp | 80548610a13b6b76515f46f56e0f7f486cf9c1c7 | [
"BSD-3-Clause"
] | null | null | null | causalicp/test/tests_icp.py | juangamella/icp | 80548610a13b6b76515f46f56e0f7f486cf9c1c7 | [
"BSD-3-Clause"
] | 1 | 2022-01-10T16:18:57.000Z | 2022-01-10T16:18:57.000Z | # Copyright 2021 Juan L. Gamella
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2... | 36.575342 | 71 | 0.673408 |
import unittest
import numpy as np
import copy
from causalicp.data import _Data
class DataTests(unittest.TestCase):
def setUp(self):
self.p = 20
self.n_obs = [2, 3, 4]
self.N = np.sum(self.n_obs)
self.e = len(self.n_obs)
self.target = 3
XX = []
for ... | true | true |
f70cab40dd4694fa9aa6eaedca1b390eac27f21d | 7,321 | py | Python | nova/tests/model_unittest.py | joshuamckenty/yolo-octo-wookie | 8e078e91d367f3deaf1785c46ee7734dd7907f24 | [
"Apache-2.0"
] | 1 | 2021-06-09T17:58:53.000Z | 2021-06-09T17:58:53.000Z | nova/tests/model_unittest.py | joshuamckenty/yolo-octo-wookie | 8e078e91d367f3deaf1785c46ee7734dd7907f24 | [
"Apache-2.0"
] | null | null | null | nova/tests/model_unittest.py | joshuamckenty/yolo-octo-wookie | 8e078e91d367f3deaf1785c46ee7734dd7907f24 | [
"Apache-2.0"
] | null | null | null | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... | 35.028708 | 78 | 0.648272 |
import logging
import time
from nova import vendor
from twisted.internet import defer
from nova import exception
from nova import flags
from nova import test
from nova import utils
from nova.compute import model
from nova.compute import node
FLAGS = flags.FLAGS
class ModelTestCase(test.TrialTestCase):
def s... | true | true |
f70caba48ad101e239a31af848fefd6f6f8a6547 | 20,208 | py | Python | src/oci/devops/models/repository_summary.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/devops/models/repository_summary.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/devops/models/repository_summary.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 31.330233 | 245 | 0.636431 |
from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel from oci.decorators import init_model_state_from_kwargs
@init_model_state_from_kwargs
class RepositorySummary(object):
def __init__(self, **kwargs):
self.swagger_types = {
'id': 'str',
... | true | true |
f70cac565f90e0edf08649c431242a2f214680bd | 23,932 | py | Python | tatk/policy/mdrg/multiwoz/model.py | yqzhangthu/tatk | 4d27e89604a33f19f1c7b8fe5dc92d4ba6c6f10a | [
"Apache-2.0"
] | 81 | 2019-03-12T13:40:29.000Z | 2022-01-17T10:59:21.000Z | tatk/policy/mdrg/multiwoz/model.py | zqwerty/tatk | fafabc45d02ad889f59354acac4e3b1367e7d4bf | [
"Apache-2.0"
] | 35 | 2019-03-13T14:05:05.000Z | 2021-08-25T15:38:14.000Z | tatk/policy/mdrg/multiwoz/model.py | zqwerty/tatk | fafabc45d02ad889f59354acac4e3b1367e7d4bf | [
"Apache-2.0"
] | 41 | 2019-03-13T09:40:24.000Z | 2022-03-07T17:59:07.000Z | import json
import math
import operator
import os
import random
from io import open
from queue import PriorityQueue
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch import optim
import functools
import tatk.policy.mdrg.multiwoz.default_policy as policy
SOS_token = 0
E... | 41.262069 | 176 | 0.617082 | import json
import math
import operator
import os
import random
from io import open
from queue import PriorityQueue
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch import optim
import functools
import tatk.policy.mdrg.multiwoz.default_policy as policy
SOS_token = 0
E... | true | true |
f70cacac5ac1a4ae9c31f4001dc3bf77f3eea737 | 56 | py | Python | pybitrix24/__init__.py | EugeneFadeev/pybitrix24 | 109173f72d1fef45342ded7e8d3b7bf70a555618 | [
"MIT"
] | null | null | null | pybitrix24/__init__.py | EugeneFadeev/pybitrix24 | 109173f72d1fef45342ded7e8d3b7bf70a555618 | [
"MIT"
] | null | null | null | pybitrix24/__init__.py | EugeneFadeev/pybitrix24 | 109173f72d1fef45342ded7e8d3b7bf70a555618 | [
"MIT"
] | null | null | null | from .pybitrix24 import Bitrix24
__version__ = '0.5.0'
| 14 | 32 | 0.75 | from .pybitrix24 import Bitrix24
__version__ = '0.5.0'
| true | true |
f70cacd055d6d041b914f6c7a1333e43c1a4c967 | 10,049 | py | Python | RecoLuminosity/LumiDB/plotdata/create_public_pileup_plots.py | nistefan/cmssw | ea13af97f7f2117a4f590a5e654e06ecd9825a5b | [
"Apache-2.0"
] | null | null | null | RecoLuminosity/LumiDB/plotdata/create_public_pileup_plots.py | nistefan/cmssw | ea13af97f7f2117a4f590a5e654e06ecd9825a5b | [
"Apache-2.0"
] | null | null | null | RecoLuminosity/LumiDB/plotdata/create_public_pileup_plots.py | nistefan/cmssw | ea13af97f7f2117a4f590a5e654e06ecd9825a5b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
######################################################################
## File: create_public_pileup_plots.py
######################################################################
# NOTE: Typical way to create the pileup ROOT file from the cached txt
# files (maintained by Mike Hildreth):
# pil... | 36.40942 | 115 | 0.610907 |
import sys
import os
import commands
import math
import optparse
import ConfigParser
import matplotlib
matplotlib.use('Agg')
from matplotlib import pyplot as plt
from RecoLuminosity.LumiDB.mpl_axes_hist_fix import hist
if matplotlib.__version__ != '1.0.1':
print >> sys.stderr, \
"ERROR The %s script c... | false | true |
f70cacd241a30e15e79ca9ff8089b49e1a95c652 | 1,814 | py | Python | examples/collapse_example.py | muyr/dayu_widgets3 | a319cc719d84c031829893c45b8f20e87cbbabc8 | [
"MIT"
] | 5 | 2020-10-16T03:46:47.000Z | 2022-03-21T07:10:37.000Z | examples/collapse_example.py | muyr/dayu_widgets3 | a319cc719d84c031829893c45b8f20e87cbbabc8 | [
"MIT"
] | null | null | null | examples/collapse_example.py | muyr/dayu_widgets3 | a319cc719d84c031829893c45b8f20e87cbbabc8 | [
"MIT"
] | 1 | 2022-02-16T14:18:43.000Z | 2022-02-16T14:18:43.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###################################################################
# Author: Mu yanru
# Date : 2019.3
# Email : muyanru345@163.com
###################################################################
from dayu_widgets3.collapse import MCollapse
from dayu_widgets3.label im... | 31.824561 | 173 | 0.581036 |
from dayu_widgets3.collapse import MCollapse
from dayu_widgets3.label import MLabel
from dayu_widgets3.qt import *
class CollapseExample(QWidget):
def __init__(self, parent=None):
super(CollapseExample, self).__init__(parent)
self._init_ui()
def _init_ui(self):
label_1 = MLabel(u'史蒂夫·... | true | true |
f70cacd5d9f463ae535ec327edb728d8d9c8030c | 12,624 | py | Python | python3-alpha/python3-src/Lib/ctypes/test/test_functions.py | stormtheh4ck3r/python-for-android | b9ea9161392f60566b81482b1e25cd77004d5c45 | [
"Apache-2.0"
] | 4 | 2016-05-04T07:05:22.000Z | 2020-09-24T00:21:05.000Z | python3-alpha/python3-src/Lib/ctypes/test/test_functions.py | stormtheh4ck3r/python-for-android | b9ea9161392f60566b81482b1e25cd77004d5c45 | [
"Apache-2.0"
] | null | null | null | python3-alpha/python3-src/Lib/ctypes/test/test_functions.py | stormtheh4ck3r/python-for-android | b9ea9161392f60566b81482b1e25cd77004d5c45 | [
"Apache-2.0"
] | 1 | 2018-12-12T03:06:17.000Z | 2018-12-12T03:06:17.000Z | """
Here is probably the place to write the docs, since the test-cases
show how the type behave.
Later...
"""
from ctypes import *
import sys, unittest
try:
WINFUNCTYPE
except NameError:
# fake to enable this test on Linux
WINFUNCTYPE = CFUNCTYPE
import _ctypes_test
dll = CDLL(_ctypes_test.__file__)
if ... | 30.941176 | 86 | 0.544598 |
from ctypes import *
import sys, unittest
try:
WINFUNCTYPE
except NameError:
WINFUNCTYPE = CFUNCTYPE
import _ctypes_test
dll = CDLL(_ctypes_test.__file__)
if sys.platform == "win32":
windll = WinDLL(_ctypes_test.__file__)
class POINT(Structure):
_fields_ = [("x", c_int), ("y", c_int)]
class RECT... | true | true |
f70cadaad1235cebd9ec3eb5772d33f7d545992f | 8,946 | py | Python | src_old/tests/scripts/iga/2d/poisson_v3.py | toddrme2178/pyccel | deec37503ab0c5d0bcca1a035f7909f7ce8ef653 | [
"MIT"
] | null | null | null | src_old/tests/scripts/iga/2d/poisson_v3.py | toddrme2178/pyccel | deec37503ab0c5d0bcca1a035f7909f7ce8ef653 | [
"MIT"
] | null | null | null | src_old/tests/scripts/iga/2d/poisson_v3.py | toddrme2178/pyccel | deec37503ab0c5d0bcca1a035f7909f7ce8ef653 | [
"MIT"
] | null | null | null | # coding: utf-8
# - run the command:
# > pyccel-quickstart poisson
# this will compile pyccel extensions and install them in $PWD/poisson/usr
# - export the following variables
# > export INCLUDE_DIR=$PWD/poisson/usr/include/poisson
# > export LIB_DIR=$PWD/poisson/usr/lib
# Usage:
# > pyccel poisson_v2.... | 25.78098 | 110 | 0.54013 |
from pyccelext.math.quadratures import legendre
from pyccelext.math.external.bsp import spl_make_open_knots
from pyccelext.math.external.bsp import spl_compute_spans
from pyccelext.math.external.bsp import spl_construct_grid_from_knots
from pyccelext.math.external.bsp import spl_construct_quadrature_grid
from pyc... | true | true |
f70cadcbe24110b3af7282ceb62b0509c18ea21a | 1,377 | py | Python | fanuc_planning/src/scripts/aruco_transforms/world_aruco_id1_tf_listener.py | oaghub/FMS | f3a4836fcb993903d239935fe05b878f3fe1f874 | [
"MIT"
] | null | null | null | fanuc_planning/src/scripts/aruco_transforms/world_aruco_id1_tf_listener.py | oaghub/FMS | f3a4836fcb993903d239935fe05b878f3fe1f874 | [
"MIT"
] | null | null | null | fanuc_planning/src/scripts/aruco_transforms/world_aruco_id1_tf_listener.py | oaghub/FMS | f3a4836fcb993903d239935fe05b878f3fe1f874 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import roslib
import rospy
import tf
import geometry_msgs.msg
from geometry_msgs.msg import Pose
if __name__ == '__main__':
rospy.init_node('world_aruco_ID_1_tf_listener')
listener = tf.TransformListener()
# Publishing the transform of the ArUco seen from the magnet aka end-effect... | 32.785714 | 114 | 0.654321 | import roslib
import rospy
import tf
import geometry_msgs.msg
from geometry_msgs.msg import Pose
if __name__ == '__main__':
rospy.init_node('world_aruco_ID_1_tf_listener')
listener = tf.TransformListener()
pub_aruco_world_pose = rospy.Publisher("world_to_aruco_ID_1/target_pose", geometry_msgs.msg... | true | true |
f70cae20241d08ae3962b49b578a5c3b6f9ba735 | 12,284 | py | Python | libp2p/stream_muxer/mplex/mplex.py | ShadowJonathan/py-libp2p | 4d814f05870f31c10927e8f1ee032ca8047b16b9 | [
"Apache-2.0",
"MIT"
] | null | null | null | libp2p/stream_muxer/mplex/mplex.py | ShadowJonathan/py-libp2p | 4d814f05870f31c10927e8f1ee032ca8047b16b9 | [
"Apache-2.0",
"MIT"
] | null | null | null | libp2p/stream_muxer/mplex/mplex.py | ShadowJonathan/py-libp2p | 4d814f05870f31c10927e8f1ee032ca8047b16b9 | [
"Apache-2.0",
"MIT"
] | 2 | 2020-10-13T07:43:55.000Z | 2020-10-27T08:51:53.000Z | import asyncio
import logging
from typing import Any # noqa: F401
from typing import Awaitable, Dict, List, Optional, Tuple
from libp2p.exceptions import ParseError
from libp2p.io.exceptions import IncompleteReadError
from libp2p.network.connection.exceptions import RawConnError
from libp2p.peer.id import ID
from lib... | 37 | 114 | 0.633507 | import asyncio
import logging
from typing import Any from typing import Awaitable, Dict, List, Optional, Tuple
from libp2p.exceptions import ParseError
from libp2p.io.exceptions import IncompleteReadError
from libp2p.network.connection.exceptions import RawConnError
from libp2p.peer.id import ID
from libp2p.security.... | true | true |
f70cae23221e6762c36e4c65e0fba61ecbd51fa9 | 7,705 | py | Python | magenta/models/arbitrary_image_stylization/arbitrary_image_stylization_distill_mobilenet.py | zhangxu999/magenta | 60b85828cc69cff855fabce78b51ddaddc873a5d | [
"Apache-2.0"
] | 17 | 2017-06-29T18:32:25.000Z | 2021-10-03T12:30:49.000Z | magenta/models/arbitrary_image_stylization/arbitrary_image_stylization_distill_mobilenet.py | zhangxu999/magenta | 60b85828cc69cff855fabce78b51ddaddc873a5d | [
"Apache-2.0"
] | 12 | 2021-02-15T07:42:08.000Z | 2022-02-08T02:05:27.000Z | magenta/models/arbitrary_image_stylization/arbitrary_image_stylization_distill_mobilenet.py | zhangxu999/magenta | 60b85828cc69cff855fabce78b51ddaddc873a5d | [
"Apache-2.0"
] | 6 | 2017-07-06T06:12:36.000Z | 2021-07-06T13:07:32.000Z | # Copyright 2020 The Magenta Authors.
#
# 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 ... | 40.552632 | 129 | 0.688254 |
import ast
import os
from magenta.models.arbitrary_image_stylization import arbitrary_image_stylization_build_mobilenet_model as build_mobilenet_model
from magenta.models.arbitrary_image_stylization import arbitrary_image_stylization_build_model as build_model
from magenta.models.image_stylization import image_utils
... | true | true |
f70caeff660f0ae67d2791ca0f3bf2000ed3e058 | 3,092 | py | Python | master/llvmpasses.py | ianshmean/julia-buildbot | 76f9c423d0c201b98707020d09045c9a4af4aac1 | [
"MIT"
] | null | null | null | master/llvmpasses.py | ianshmean/julia-buildbot | 76f9c423d0c201b98707020d09045c9a4af4aac1 | [
"MIT"
] | null | null | null | master/llvmpasses.py | ianshmean/julia-buildbot | 76f9c423d0c201b98707020d09045c9a4af4aac1 | [
"MIT"
] | null | null | null | julia_llvmpasses_factory = util.BuildFactory()
julia_llvmpasses_factory.useProgress = True
julia_llvmpasses_factory.addSteps([
# Fetch first (allowing failure if no existing clone is present)
steps.ShellCommand(
name="git fetch",
command=["git", "fetch", "--tags", "--all", "--force"],
fl... | 34.355556 | 153 | 0.639715 | julia_llvmpasses_factory = util.BuildFactory()
julia_llvmpasses_factory.useProgress = True
julia_llvmpasses_factory.addSteps([
steps.ShellCommand(
name="git fetch",
command=["git", "fetch", "--tags", "--all", "--force"],
flunkOnFailure=False
),
steps.Git(
name="Julia... | true | true |
f70caf336c711737e2bc6b173a4fdab41dc8a3b0 | 3,267 | py | Python | experiments/ca/ext.py | UKPLab/curriculum-annotation | 1d6ca490ea180019bb09d1d3818874f4321d4d0f | [
"Apache-2.0"
] | null | null | null | experiments/ca/ext.py | UKPLab/curriculum-annotation | 1d6ca490ea180019bb09d1d3818874f4321d4d0f | [
"Apache-2.0"
] | null | null | null | experiments/ca/ext.py | UKPLab/curriculum-annotation | 1d6ca490ea180019bb09d1d3818874f4321d4d0f | [
"Apache-2.0"
] | null | null | null | from typing import List, Tuple
import pandas as pd
@pd.api.extensions.register_dataframe_accessor("tag")
class CaTaggingAccessor:
def __init__(self, df: pd.DataFrame):
self._df = df
def group_by_sentences(self):
yield from (x[1] for x in self._df.groupby("sentence_id"))
def group_by_doc... | 29.169643 | 92 | 0.590756 | from typing import List, Tuple
import pandas as pd
@pd.api.extensions.register_dataframe_accessor("tag")
class CaTaggingAccessor:
def __init__(self, df: pd.DataFrame):
self._df = df
def group_by_sentences(self):
yield from (x[1] for x in self._df.groupby("sentence_id"))
def group_by_doc... | true | true |
f70cafe61bd60c467537a3027e0789791601ad09 | 8,937 | py | Python | forte/data/ontology/code_generation_util.py | tcl326/forte | d0d7b8b97da5e1d507dfa7cd4ec51d96067770b8 | [
"Apache-2.0"
] | null | null | null | forte/data/ontology/code_generation_util.py | tcl326/forte | d0d7b8b97da5e1d507dfa7cd4ec51d96067770b8 | [
"Apache-2.0"
] | 13 | 2019-12-01T04:51:38.000Z | 2020-02-11T23:55:11.000Z | forte/data/ontology/code_generation_util.py | tcl326/forte | d0d7b8b97da5e1d507dfa7cd4ec51d96067770b8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 The Forte Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 36.329268 | 79 | 0.596397 | import os
from collections import OrderedDict
from typing import Optional, Any, List
class Config:
indent: int = 4
line_break: str = os.linesep
def indent(level: int) -> str:
return ' ' * Config.indent * level
def indent_line(line: str, level: int) -> str:
return f"{indent(level)}{line}" if line e... | true | true |
f70cb0ad2ce41c37d7ca1d87ed20ebab11b77969 | 4,092 | py | Python | carbonplan_data/tests/__init__.py | carbonplan/data | 9eb84991650ac9a75ae622d3aac754794ada9405 | [
"MIT"
] | 8 | 2020-06-29T18:15:00.000Z | 2022-02-16T11:10:23.000Z | carbonplan_data/tests/__init__.py | carbonplan/data | 9eb84991650ac9a75ae622d3aac754794ada9405 | [
"MIT"
] | 159 | 2020-06-05T04:54:16.000Z | 2022-03-29T04:09:30.000Z | carbonplan_data/tests/__init__.py | carbonplan/data | 9eb84991650ac9a75ae622d3aac754794ada9405 | [
"MIT"
] | 4 | 2021-01-26T22:02:07.000Z | 2021-11-23T22:26:20.000Z | # Based on scikit-learn/sklearn/utils/estimator_checks.py
import itertools
from functools import partial
def get_entry_params(entry):
user_parameters = entry.describe()["user_parameters"]
if not user_parameters:
return []
keys = [p["name"] for p in user_parameters]
try:
values = [p["a... | 28.615385 | 93 | 0.637341 | import itertools
from functools import partial
def get_entry_params(entry):
user_parameters = entry.describe()["user_parameters"]
if not user_parameters:
return []
keys = [p["name"] for p in user_parameters]
try:
values = [p["allowed"] for p in user_parameters]
except KeyError:
... | true | true |
f70cb0df208ce61fa914f50e3672edb1081c3638 | 272,527 | py | Python | jax/_src/lax/lax.py | gmittal/jax | 281816221dea03c64f6d8b61253397c719c55feb | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | jax/_src/lax/lax.py | gmittal/jax | 281816221dea03c64f6d8b61253397c719c55feb | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | jax/_src/lax/lax.py | gmittal/jax | 281816221dea03c64f6d8b61253397c719c55feb | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # 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, ... | 42.877124 | 141 | 0.706781 |
import builtins
import functools
import itertools
import operator
from typing import (Any, Callable, List, NamedTuple, Optional, Sequence, Union, Tuple)
import warnings
import numpy as np
import jax
from jax import core
from jax import ad_util
from jax import api
from jax import api_util
from jax import linear_util... | true | true |
f70cb274777106042cfdd47c23d84236c554d7ee | 6,235 | py | Python | server/api/organisations/campaigns.py | Guillon88/tasking-manager | 8f05eef7cb008c680a82dc9884ab7a83a12ab1f8 | [
"BSD-2-Clause"
] | 1 | 2021-08-02T15:32:31.000Z | 2021-08-02T15:32:31.000Z | server/api/organisations/campaigns.py | Guillon88/tasking-manager | 8f05eef7cb008c680a82dc9884ab7a83a12ab1f8 | [
"BSD-2-Clause"
] | null | null | null | server/api/organisations/campaigns.py | Guillon88/tasking-manager | 8f05eef7cb008c680a82dc9884ab7a83a12ab1f8 | [
"BSD-2-Clause"
] | null | null | null | from flask_restful import Resource, current_app
from server.services.campaign_service import CampaignService
from server.services.organisation_service import OrganisationService
from server.models.postgis.utils import NotFound
from server.models.postgis.campaign import Campaign
from server.services.users.authenticatio... | 35.628571 | 92 | 0.54146 | from flask_restful import Resource, current_app
from server.services.campaign_service import CampaignService
from server.services.organisation_service import OrganisationService
from server.models.postgis.utils import NotFound
from server.models.postgis.campaign import Campaign
from server.services.users.authenticatio... | true | true |
f70cb2dc8973317c598e3990ad6648c0f1901bc2 | 15,151 | py | Python | tools/program.py | ruyijidan/PaddleClas | b986937cd2935d1a6591a9d19de7c07710632624 | [
"Apache-2.0"
] | null | null | null | tools/program.py | ruyijidan/PaddleClas | b986937cd2935d1a6591a9d19de7c07710632624 | [
"Apache-2.0"
] | null | null | null | tools/program.py | ruyijidan/PaddleClas | b986937cd2935d1a6591a9d19de7c07710632624 | [
"Apache-2.0"
] | null | null | null | # copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.
#
# 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 applica... | 32.443255 | 92 | 0.613029 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import time
from collections import OrderedDict
import paddle.fluid as fluid
from ppcls.optimizer import LearningRateBuilder
from ppcls.optimizer import OptimizerBuilder
from ppcls.modeling import... | true | true |
f70cb3c8e0c52829eda3f1fe33c1cc0d730b9691 | 6,355 | py | Python | repo/plugin.video.frenchdj.media.center/resources/lib/sources/oneclickwatch_mv_tv.py | Hades01/Addons | 710da97ac850197498a3cd64be1811c593610add | [
"Apache-2.0"
] | null | null | null | repo/plugin.video.frenchdj.media.center/resources/lib/sources/oneclickwatch_mv_tv.py | Hades01/Addons | 710da97ac850197498a3cd64be1811c593610add | [
"Apache-2.0"
] | null | null | null | repo/plugin.video.frenchdj.media.center/resources/lib/sources/oneclickwatch_mv_tv.py | Hades01/Addons | 710da97ac850197498a3cd64be1811c593610add | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Specto Add-on
Copyright (C) 2015 lambda
This program 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 l... | 36.947674 | 125 | 0.561448 |
import re,urlparse,time, urllib
from resources.lib.libraries import client
from resources.lib.libraries import client2
from resources.lib.libraries import cleantitle
from resources.lib.libraries import workers
from resources.lib.libraries import control
from resources.lib.resolvers import cloudzilla
from resources... | true | true |
f70cb404ff70014a8e6b2a47aa2bfba1304d3c59 | 31,360 | py | Python | hd_recognition/GUI.py | Seledriac/A-small-python-library-for-deep-learning | c041287b04ba217910f621d34c7739365c36ad48 | [
"MIT"
] | 1 | 2020-06-11T05:04:08.000Z | 2020-06-11T05:04:08.000Z | hd_recognition/GUI.py | Seledriac/A-small-python-library-for-deep-learning | c041287b04ba217910f621d34c7739365c36ad48 | [
"MIT"
] | 3 | 2020-06-14T10:26:57.000Z | 2020-06-14T10:37:58.000Z | hd_recognition/GUI.py | Seledriac/A-small-python-library-for-deep-learning | c041287b04ba217910f621d34c7739365c36ad48 | [
"MIT"
] | null | null | null |
# -*- coding:utf-8 -*-
"""Handwritten digits recognition Graphic interface module : training done with the mnist dataset"""
# Third-party gui/system/plotting Libraries
import numpy as np
import tkinter as tk
import tkinter.font as tkFont
from tkinter import messagebox
from tkinter import filedialog
from matplotlib.b... | 48.395062 | 216 | 0.625797 |
import numpy as np
import tkinter as tk
import tkinter.font as tkFont
from tkinter import messagebox
from tkinter import filedialog
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
from matplotlib.figure import Figure
from PIL import ImageTk, Image
from PyQt5.QtWidgets import QApplication, QMainWindow... | true | true |
f70cb4b1b49d0fb0f3970e183f9e1c31c8780f60 | 13,476 | py | Python | nomenklatura/resolver.py | opensanctions/nomenklatura | d845ff821a57beffb49b269b4d8c08f57bc588d7 | [
"MIT"
] | 4 | 2022-02-25T13:32:20.000Z | 2022-03-15T23:35:42.000Z | nomenklatura/resolver.py | opensanctions/nomenklatura | d845ff821a57beffb49b269b4d8c08f57bc588d7 | [
"MIT"
] | null | null | null | nomenklatura/resolver.py | opensanctions/nomenklatura | d845ff821a57beffb49b269b4d8c08f57bc588d7 | [
"MIT"
] | 1 | 2022-03-02T16:56:48.000Z | 2022-03-02T16:56:48.000Z | import json
import getpass
import shortuuid # type: ignore
from datetime import datetime
from functools import lru_cache
from collections import defaultdict
from typing import Any, Dict, Generator, Generic, List, Optional, Set, Tuple, Union
from followthemoney.types import registry
from nomenklatura.entity import CE
... | 34.642674 | 86 | 0.58875 | import json
import getpass
import shortuuid from datetime import datetime
from functools import lru_cache
from collections import defaultdict
from typing import Any, Dict, Generator, Generic, List, Optional, Set, Tuple, Union
from followthemoney.types import registry
from nomenklatura.entity import CE
from nomenklatu... | true | true |
f70cb50a820e5478ac56b1d142049faed4d62e57 | 4,778 | py | Python | httpie_oauth2_client_credentials.py | satodoc/httpie-oauth2-client-credentials | 831d1c910e43457d6c64f2f940ee279cd9f58895 | [
"MIT"
] | null | null | null | httpie_oauth2_client_credentials.py | satodoc/httpie-oauth2-client-credentials | 831d1c910e43457d6c64f2f940ee279cd9f58895 | [
"MIT"
] | null | null | null | httpie_oauth2_client_credentials.py | satodoc/httpie-oauth2-client-credentials | 831d1c910e43457d6c64f2f940ee279cd9f58895 | [
"MIT"
] | null | null | null | '''
OAuth2.0 client credentials flow plugin for HTTPie.
'''
import sys
from httpie.plugins import AuthPlugin
from httpie.cli.definition import parser as httpie_args_parser
from urllib.request import Request, urlopen
from urllib.parse import urlencode
from urllib.error import HTTPError
import json
from base64 import b6... | 38.532258 | 124 | 0.619506 |
import sys
from httpie.plugins import AuthPlugin
from httpie.cli.definition import parser as httpie_args_parser
from urllib.request import Request, urlopen
from urllib.parse import urlencode
from urllib.error import HTTPError
import json
from base64 import b64encode
class OAuth2ClientCredentials:
def __init__(se... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.