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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c19a5e7dfd425103dc02c26342a6bd42b9f7ee3 | 29,292 | py | Python | tests/components/yeelight/test_config_flow.py | mcx/core | 55eca2e2b4ebcf11486749035fd3c7e77ea14b8f | [
"Apache-2.0"
] | 30,023 | 2016-04-13T10:17:53.000Z | 2020-03-02T12:56:31.000Z | tests/components/yeelight/test_config_flow.py | mcx/core | 55eca2e2b4ebcf11486749035fd3c7e77ea14b8f | [
"Apache-2.0"
] | 24,710 | 2016-04-13T08:27:26.000Z | 2020-03-02T12:59:13.000Z | tests/components/yeelight/test_config_flow.py | mcx/core | 55eca2e2b4ebcf11486749035fd3c7e77ea14b8f | [
"Apache-2.0"
] | 11,956 | 2016-04-13T18:42:31.000Z | 2020-03-02T09:32:12.000Z | """Test the Yeelight config flow."""
from unittest.mock import patch
import pytest
from homeassistant import config_entries
from homeassistant.components import dhcp, ssdp, zeroconf
from homeassistant.components.yeelight.config_flow import MODEL_UNKNOWN, CannotConnect
from homeassistant.components.yeelight.const impo... | 36.073892 | 92 | 0.668476 | from unittest.mock import patch
import pytest
from homeassistant import config_entries
from homeassistant.components import dhcp, ssdp, zeroconf
from homeassistant.components.yeelight.config_flow import MODEL_UNKNOWN, CannotConnect
from homeassistant.components.yeelight.const import (
CONF_DETECTED_MODEL,
CON... | true | true |
1c19a6b07c8c886b3cd8ff47e74d6895dd9c225f | 403 | py | Python | py2_djangoapp/wsgi.py | simkimsia/example-django-app | 8b65f88ef8707f32acb19bc99731248d1933d231 | [
"MIT"
] | null | null | null | py2_djangoapp/wsgi.py | simkimsia/example-django-app | 8b65f88ef8707f32acb19bc99731248d1933d231 | [
"MIT"
] | null | null | null | py2_djangoapp/wsgi.py | simkimsia/example-django-app | 8b65f88ef8707f32acb19bc99731248d1933d231 | [
"MIT"
] | null | null | null | """
WSGI config for py2_djangoapp project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO... | 23.705882 | 78 | 0.791563 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "py2_djangoapp.settings")
application = get_wsgi_application()
| true | true |
1c19a6deb1c0c0278e34bb5e292f4988b16756be | 180 | py | Python | person.py | Ragnamus/historia | 489ff537429a6a0bc2c700c57fccd0cbdca744a3 | [
"MIT"
] | null | null | null | person.py | Ragnamus/historia | 489ff537429a6a0bc2c700c57fccd0cbdca744a3 | [
"MIT"
] | null | null | null | person.py | Ragnamus/historia | 489ff537429a6a0bc2c700c57fccd0cbdca744a3 | [
"MIT"
] | null | null | null | class Person:
def __init__(self, birth, gender, name, surname):
self.birth = birth
self.gender = gender
self.name = name
self.surname = surname
| 25.714286 | 53 | 0.6 | class Person:
def __init__(self, birth, gender, name, surname):
self.birth = birth
self.gender = gender
self.name = name
self.surname = surname
| true | true |
1c19a90a1ab6ecff32bdbd92ac19d6382e98cc63 | 3,452 | py | Python | household_contact_tracing/distributions.py | TTI-modelling/TestingContactModel | 76e0fd9ae2b2e95c330ed5e5515f6cd1ba22be55 | [
"MIT"
] | null | null | null | household_contact_tracing/distributions.py | TTI-modelling/TestingContactModel | 76e0fd9ae2b2e95c330ed5e5515f6cd1ba22be55 | [
"MIT"
] | null | null | null | household_contact_tracing/distributions.py | TTI-modelling/TestingContactModel | 76e0fd9ae2b2e95c330ed5e5515f6cd1ba22be55 | [
"MIT"
] | null | null | null | # Maths that describes statistical distributions
import math
from scipy import integrate as si
gen_shape = 2.826
gen_scale = 5.665
def weibull_pdf(t):
out = (gen_shape / gen_scale) * (t / gen_scale)**(gen_shape - 1) * math.exp(-(t / gen_scale)**gen_shape)
return out
def weibull_survival(t):
return ma... | 35.958333 | 120 | 0.694959 |
import math
from scipy import integrate as si
gen_shape = 2.826
gen_scale = 5.665
def weibull_pdf(t):
out = (gen_shape / gen_scale) * (t / gen_scale)**(gen_shape - 1) * math.exp(-(t / gen_scale)**gen_shape)
return out
def weibull_survival(t):
return math.exp(-(t / gen_scale)**gen_shape)
def uncond... | true | true |
1c19a953b00b3f18b3a7811f8fbe54410ae01a6a | 111 | py | Python | bardhub/musicplayersetting/apps.py | migdotcom/music-library | 4648ea02e4b071c4a287eba09202045963992873 | [
"MIT"
] | null | null | null | bardhub/musicplayersetting/apps.py | migdotcom/music-library | 4648ea02e4b071c4a287eba09202045963992873 | [
"MIT"
] | null | null | null | bardhub/musicplayersetting/apps.py | migdotcom/music-library | 4648ea02e4b071c4a287eba09202045963992873 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class MusicplayersettingConfig(AppConfig):
name = 'musicplayersetting'
| 18.5 | 42 | 0.801802 | from django.apps import AppConfig
class MusicplayersettingConfig(AppConfig):
name = 'musicplayersetting'
| true | true |
1c19a9e847c69026b45d776b1f33bbfb10d10a2e | 13,271 | py | Python | models/enc_vanilla.py | nguyentthai96/Mem2Seq | 70b548ae56e7b8ead8ae0352cbdbd385a89ffbef | [
"MIT"
] | 354 | 2018-05-01T09:16:26.000Z | 2022-02-16T16:24:54.000Z | models/enc_vanilla.py | kolaSamuel/Mem2Seq | 7ad9fb8c2e70b39ebfcbea659d755d0ee9c2bbf5 | [
"MIT"
] | 27 | 2018-06-24T13:11:47.000Z | 2021-08-23T12:59:29.000Z | models/enc_vanilla.py | kolaSamuel/Mem2Seq | 7ad9fb8c2e70b39ebfcbea659d755d0ee9c2bbf5 | [
"MIT"
] | 111 | 2018-04-30T16:00:06.000Z | 2022-03-03T10:41:10.000Z | import torch
import torch.nn as nn
from torch.autograd import Variable
from torch import optim
import torch.nn.functional as F
from utils.masked_cross_entropy import *
from utils.config import *
import random
import numpy as np
import datetime
from utils.measures import wer,moses_multi_bleu
import nltk
from sklearn.met... | 42.809677 | 184 | 0.605908 | import torch
import torch.nn as nn
from torch.autograd import Variable
from torch import optim
import torch.nn.functional as F
from utils.masked_cross_entropy import *
from utils.config import *
import random
import numpy as np
import datetime
from utils.measures import wer,moses_multi_bleu
import nltk
from sklearn.met... | true | true |
1c19aa546d4db619c1eb1d0e781354c16342a21d | 272 | py | Python | tests/artificial/transf_Integration/trend_ConstantTrend/cycle_5/ar_12/test_artificial_1024_Integration_ConstantTrend_5_12_20.py | shaido987/pyaf | b9afd089557bed6b90b246d3712c481ae26a1957 | [
"BSD-3-Clause"
] | 377 | 2016-10-13T20:52:44.000Z | 2022-03-29T18:04:14.000Z | tests/artificial/transf_Integration/trend_ConstantTrend/cycle_5/ar_12/test_artificial_1024_Integration_ConstantTrend_5_12_20.py | ysdede/pyaf | b5541b8249d5a1cfdc01f27fdfd99b6580ed680b | [
"BSD-3-Clause"
] | 160 | 2016-10-13T16:11:53.000Z | 2022-03-28T04:21:34.000Z | tests/artificial/transf_Integration/trend_ConstantTrend/cycle_5/ar_12/test_artificial_1024_Integration_ConstantTrend_5_12_20.py | ysdede/pyaf | b5541b8249d5a1cfdc01f27fdfd99b6580ed680b | [
"BSD-3-Clause"
] | 63 | 2017-03-09T14:51:18.000Z | 2022-03-27T20:52:57.000Z | import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "ConstantTrend", cycle_length = 5, transform = "Integration", sigma = 0.0, exog_count = 20, ar_order = 12); | 38.857143 | 172 | 0.738971 | import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "ConstantTrend", cycle_length = 5, transform = "Integration", sigma = 0.0, exog_count = 20, ar_order = 12); | true | true |
1c19ab4b1e673b18bf3d30389e85511887433f0f | 839 | py | Python | src/cortex/clientFactory.py | olgazharikova/bci-emotiv-pygame-fruitrally | d649eb1abbc83c647e2c276ea353329e9b813256 | [
"MIT"
] | null | null | null | src/cortex/clientFactory.py | olgazharikova/bci-emotiv-pygame-fruitrally | d649eb1abbc83c647e2c276ea353329e9b813256 | [
"MIT"
] | null | null | null | src/cortex/clientFactory.py | olgazharikova/bci-emotiv-pygame-fruitrally | d649eb1abbc83c647e2c276ea353329e9b813256 | [
"MIT"
] | 1 | 2021-11-12T05:16:14.000Z | 2021-11-12T05:16:14.000Z | from autobahn.twisted.websocket import WebSocketClientFactory
from src.cortex.clientProtocol import CortexClientProtocol
class CortexClientFactory(WebSocketClientFactory):
"""
Class for twisted client factory (Twisted-based WebSocket client factories) to combine additional parameters
of the client with ... | 36.478261 | 113 | 0.72944 | from autobahn.twisted.websocket import WebSocketClientFactory
from src.cortex.clientProtocol import CortexClientProtocol
class CortexClientFactory(WebSocketClientFactory):
protocol = CortexClientProtocol
def __init__(self, url, credentials, receiver):
WebSocketClientFactory.__init__(self, url)
... | true | true |
1c19abe8663bdbc3524485210a4b18a9449b4cd5 | 4,633 | py | Python | services/web/server/src/simcore_service_webserver/groups_classifiers.py | colinRawlings/osparc-simcore | bf2f18d5bc1e574d5f4c238d08ad15156184c310 | [
"MIT"
] | 25 | 2018-04-13T12:44:12.000Z | 2022-03-12T15:01:17.000Z | services/web/server/src/simcore_service_webserver/groups_classifiers.py | colinRawlings/osparc-simcore | bf2f18d5bc1e574d5f4c238d08ad15156184c310 | [
"MIT"
] | 2,553 | 2018-01-18T17:11:55.000Z | 2022-03-31T16:26:40.000Z | services/web/server/src/simcore_service_webserver/groups_classifiers.py | odeimaiz/osparc-simcore | 71c2fc58dcfe067487dcd75cb70298a4d6237e97 | [
"MIT"
] | 20 | 2018-01-18T19:45:33.000Z | 2022-03-29T07:08:47.000Z | """
- Every group has a set of "official" classifiers and its users tag studies with them
- Classifiers can be defined in two ways:
1. a static bundle that is stored in group_classifiers.c.bundle
2. using research resources from scicrunch.org (see group_classifiers.c.uses_scicrunch )
- The A... | 33.330935 | 96 | 0.635873 |
import logging
from typing import Any, Dict, Optional
import sqlalchemy as sa
from aiohttp import web
from aiopg.sa.result import RowProxy
from pydantic import BaseModel, Field, HttpUrl, ValidationError, constr, validator
from simcore_postgres_database.models.classifiers import group_classifiers
from .constants impo... | true | true |
1c19ac2682cc0aa22c9a87a7391e92deb648313a | 18,394 | py | Python | website/map/views.py | compsoc-edinburgh/mapp-site | 9901b59713d2523ee9dc6b7db392c89872e7b832 | [
"MIT"
] | 4 | 2018-04-09T12:18:31.000Z | 2019-03-07T14:05:20.000Z | website/map/views.py | compsoc-edinburgh/mapp-worker-py | 9901b59713d2523ee9dc6b7db392c89872e7b832 | [
"MIT"
] | 21 | 2018-01-16T09:50:50.000Z | 2019-05-29T17:22:11.000Z | website/map/views.py | compsoc-edinburgh/mapp-worker | 9901b59713d2523ee9dc6b7db392c89872e7b832 | [
"MIT"
] | 2 | 2019-10-06T22:08:43.000Z | 2019-11-11T19:52:18.000Z | from map import app, flask_redis, ldap
from .user import check_uun_hash
from typing import List, Optional
import time
import hashlib
import json, re
from flask import render_template, request, jsonify, redirect, make_response
from flask_login import login_user, logout_user, login_required, current_user
import csv
from ... | 30.81072 | 153 | 0.537675 | from map import app, flask_redis, ldap
from .user import check_uun_hash
from typing import List, Optional
import time
import hashlib
import json, re
from flask import render_template, request, jsonify, redirect, make_response
from flask_login import login_user, logout_user, login_required, current_user
import csv
from ... | true | true |
1c19ad255af848ecb10d2e553ae40d87cb62e12d | 4,569 | py | Python | salt/returners/librato_return.py | Noah-Huppert/salt | 998c382f5f2c3b4cbf7d96aa6913ada6993909b3 | [
"Apache-2.0"
] | 19 | 2016-01-29T14:37:52.000Z | 2022-03-30T18:08:01.000Z | salt/returners/librato_return.py | Noah-Huppert/salt | 998c382f5f2c3b4cbf7d96aa6913ada6993909b3 | [
"Apache-2.0"
] | 223 | 2016-03-02T16:39:41.000Z | 2022-03-03T12:26:35.000Z | salt/returners/librato_return.py | Noah-Huppert/salt | 998c382f5f2c3b4cbf7d96aa6913ada6993909b3 | [
"Apache-2.0"
] | 64 | 2016-02-04T19:45:26.000Z | 2021-12-15T02:02:31.000Z | # -*- coding: utf-8 -*-
"""
Salt returner to return highstate stats to Librato
To enable this returner the minion will need the Librato
client importable on the Python path and the following
values configured in the minion or master config.
The Librato python client can be found at:
https://github.com/librato/python-... | 28.030675 | 97 | 0.643686 |
from __future__ import absolute_import, print_function, unicode_literals
import logging
import salt.returners
import salt.utils.jid
try:
import librato
HAS_LIBRATO = True
except ImportError:
HAS_LIBRATO = False
__virtualname__ = "librato"
log = logging.getLogger(__name__)
def __virtual__():
... | true | true |
1c19ad6155c1fa50ed5353b2cac260de3b519aaa | 1,533 | py | Python | rest_api/application.py | SjSnowball/haystack | bb066c0a2c10253cf2bf7eb8cc829f1a0edde84d | [
"Apache-2.0"
] | 4,544 | 2019-11-14T11:57:49.000Z | 2022-03-31T17:41:18.000Z | rest_api/application.py | SjSnowball/haystack | bb066c0a2c10253cf2bf7eb8cc829f1a0edde84d | [
"Apache-2.0"
] | 1,679 | 2020-01-14T15:55:58.000Z | 2022-03-31T20:55:25.000Z | rest_api/application.py | SjSnowball/haystack | bb066c0a2c10253cf2bf7eb8cc829f1a0edde84d | [
"Apache-2.0"
] | 820 | 2019-11-27T13:01:42.000Z | 2022-03-31T12:54:34.000Z | import logging
from pathlib import Path
import uvicorn
from fastapi import FastAPI, HTTPException
from starlette.middleware.cors import CORSMiddleware
from rest_api.controller.errors.http_error import http_error_handler
from rest_api.config import ROOT_PATH
logging.basicConfig(format="%(asctime)s %(message)s", date... | 31.285714 | 173 | 0.741031 | import logging
from pathlib import Path
import uvicorn
from fastapi import FastAPI, HTTPException
from starlette.middleware.cors import CORSMiddleware
from rest_api.controller.errors.http_error import http_error_handler
from rest_api.config import ROOT_PATH
logging.basicConfig(format="%(asctime)s %(message)s", date... | true | true |
1c19ada7d029c2cd1cb3dfdca0f415b139bb6ff3 | 9,760 | py | Python | roadsearch/tunning/optimize.py | ERATOMMSD/roadsearch | e5b32b70835a51d56d10547720d90e34ade08564 | [
"MIT"
] | null | null | null | roadsearch/tunning/optimize.py | ERATOMMSD/roadsearch | e5b32b70835a51d56d10547720d90e34ade08564 | [
"MIT"
] | null | null | null | roadsearch/tunning/optimize.py | ERATOMMSD/roadsearch | e5b32b70835a51d56d10547720d90e34ade08564 | [
"MIT"
] | null | null | null | #
#
#
#
# Base code borrowed from https://github.com/se2p/tool-competition-av/blob/main/competition.py
import traceback
import time
import os
import sys
import errno
import logging as log
import click
from sbst_beamng.code_pipeline.tests_generation import TestGenerationStatistic
OUTPUT_RESULTS_TO = 'results'
def get... | 41.355932 | 122 | 0.693955 |
import traceback
import time
import os
import sys
import errno
import logging as log
import click
from sbst_beamng.code_pipeline.tests_generation import TestGenerationStatistic
OUTPUT_RESULTS_TO = 'results'
def get_script_path():
return os.path.dirname(os.path.realpath(sys.argv[0]))
def validate_map_size(... | true | true |
1c19af711ab941c5e21be3a4df3a6194af0eb88a | 25,553 | py | Python | my_plugins/YouCompleteMe/third_party/ycmd/ycmd/completers/java/java_completer.py | cyx233/vim_config | f09c9206344c17df20a05dd2c08a02f098a7e873 | [
"MIT"
] | null | null | null | my_plugins/YouCompleteMe/third_party/ycmd/ycmd/completers/java/java_completer.py | cyx233/vim_config | f09c9206344c17df20a05dd2c08a02f098a7e873 | [
"MIT"
] | null | null | null | my_plugins/YouCompleteMe/third_party/ycmd/ycmd/completers/java/java_completer.py | cyx233/vim_config | f09c9206344c17df20a05dd2c08a02f098a7e873 | [
"MIT"
] | null | null | null | # Copyright (C) 2017-2019 ycmd contributors
#
# This file is part of ycmd.
#
# ycmd is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
#... | 33.622368 | 80 | 0.658279 |
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from builtins import * # noqa
import glob
import hashlib
import json
import os
import shutil
import tempfile
import threading
from subprocess import PI... | true | true |
1c19b0a5e13a1546ebc4214415054c2c4cd82724 | 4,219 | py | Python | nova/objects/bandwidth_usage.py | MagnusR/nova | 798b8d2d825fcf259279ba4370e734242598f76f | [
"Apache-2.0"
] | 1 | 2021-11-05T06:26:27.000Z | 2021-11-05T06:26:27.000Z | nova/objects/bandwidth_usage.py | MagnusR/nova | 798b8d2d825fcf259279ba4370e734242598f76f | [
"Apache-2.0"
] | 3 | 2019-05-17T15:49:12.000Z | 2019-11-21T10:49:54.000Z | nova/objects/bandwidth_usage.py | MagnusR/nova | 798b8d2d825fcf259279ba4370e734242598f76f | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | 40.961165 | 79 | 0.657028 |
from nova.db.main import api as db
from nova.objects import base
from nova.objects import fields
@base.NovaObjectRegistry.register
class BandwidthUsage(base.NovaPersistentObject, base.NovaObject):
VERSION = '1.2'
fields = {
'instance_uuid': fields.UUIDField(),
'ma... | true | true |
1c19b24572f2ee2edd24814644ad9168b5a4da25 | 2,464 | py | Python | producer-raw-recipies.py | vicmar57/Recipe-Calorie-Alert-using-Kafka | e6a267b6e04cf3a483ce05d445a20831cd1f5125 | [
"MIT"
] | null | null | null | producer-raw-recipies.py | vicmar57/Recipe-Calorie-Alert-using-Kafka | e6a267b6e04cf3a483ce05d445a20831cd1f5125 | [
"MIT"
] | null | null | null | producer-raw-recipies.py | vicmar57/Recipe-Calorie-Alert-using-Kafka | e6a267b6e04cf3a483ce05d445a20831cd1f5125 | [
"MIT"
] | null | null | null | from time import sleep
import requests
from bs4 import BeautifulSoup
from kafka import KafkaProducer
def publish_message(producer_instance, topic_name, key, value):
try:
key_bytes = bytes(key, encoding='utf-8')
value_bytes = bytes(value, encoding='utf-8')
producer_instance.send(topic_name... | 29.686747 | 146 | 0.616883 | from time import sleep
import requests
from bs4 import BeautifulSoup
from kafka import KafkaProducer
def publish_message(producer_instance, topic_name, key, value):
try:
key_bytes = bytes(key, encoding='utf-8')
value_bytes = bytes(value, encoding='utf-8')
producer_instance.send(topic_name... | true | true |
1c19b4316e1af291c1bcc3f325c5979af4f58162 | 2,458 | py | Python | src/soorgeon/definitions.py | jramirez857/soorgeon | 54ab679f72be38731f5b43c6835f9a14921c396d | [
"Apache-2.0"
] | 26 | 2021-12-01T10:00:31.000Z | 2022-03-24T18:21:58.000Z | src/soorgeon/definitions.py | jramirez857/soorgeon | 54ab679f72be38731f5b43c6835f9a14921c396d | [
"Apache-2.0"
] | 31 | 2021-12-20T03:20:37.000Z | 2022-03-15T01:14:40.000Z | src/soorgeon/definitions.py | jramirez857/soorgeon | 54ab679f72be38731f5b43c6835f9a14921c396d | [
"Apache-2.0"
] | 4 | 2022-02-03T21:40:55.000Z | 2022-03-26T21:55:33.000Z | from functools import reduce
from isort import place_module
# NOTE: we use this in find_inputs_and_outputs and ImportParser, maybe
# move the functionality to a class so we only compute it once
def from_imports(tree):
# build a defined-name -> import-statement-code mapping. Note that
# the same code may appea... | 28.917647 | 79 | 0.62856 | from functools import reduce
from isort import place_module
def from_imports(tree):
imports = [{
name.value: import_.get_code().rstrip()
for name in import_.get_defined_names()
} for import_ in tree.iter_imports()]
if imports:
imports = reduce(lambda x, y: {**x, *... | true | true |
1c19b530a89ed17b34a1dacda33a5a07b17d5567 | 1,237 | py | Python | Python Project Filter-Detect-GUI/mne/decoding/tests/test_time_frequency.py | JulienL3vesque/Hexoskin_RnD_OSM | b524430d6f4b2b300d119b6a1586141e6c2d14a3 | [
"MIT"
] | null | null | null | Python Project Filter-Detect-GUI/mne/decoding/tests/test_time_frequency.py | JulienL3vesque/Hexoskin_RnD_OSM | b524430d6f4b2b300d119b6a1586141e6c2d14a3 | [
"MIT"
] | 2 | 2019-08-14T06:21:15.000Z | 2020-10-29T19:54:56.000Z | Python Project Filter-Detect-GUI/mne/decoding/tests/test_time_frequency.py | JulienL3vesque/Hexoskin_RnD_OSM | b524430d6f4b2b300d119b6a1586141e6c2d14a3 | [
"MIT"
] | 1 | 2017-12-05T05:13:56.000Z | 2017-12-05T05:13:56.000Z | # Author: Jean-Remi King, <jeanremi.king@gmail.com>
#
# License: BSD (3-clause)
import numpy as np
from numpy.testing import assert_array_equal
from nose.tools import assert_raises
from mne.utils import requires_sklearn
from mne.decoding.time_frequency import TimeFrequency
@requires_sklearn
def test_timefrequency()... | 29.452381 | 76 | 0.691188 |
import numpy as np
from numpy.testing import assert_array_equal
from nose.tools import assert_raises
from mne.utils import requires_sklearn
from mne.decoding.time_frequency import TimeFrequency
@requires_sklearn
def test_timefrequency():
from sklearn.base import clone
n_freqs = 3
frequencies = n... | true | true |
1c19b54135bedcb8c2ed796f4a4ffc3daebbef16 | 20,784 | py | Python | cvxpy/tests/test_dqcp.py | TShimko126/cvxpy | 8b89b3f8ef7daba1db39f5029e4902f06c75b29f | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | cvxpy/tests/test_dqcp.py | TShimko126/cvxpy | 8b89b3f8ef7daba1db39f5029e4902f06c75b29f | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | cvxpy/tests/test_dqcp.py | TShimko126/cvxpy | 8b89b3f8ef7daba1db39f5029e4902f06c75b29f | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | """
Copyright, the CVXPY 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 writing, software
... | 37.114286 | 82 | 0.618023 | import cvxpy as cp
from cvxpy.reductions.solvers import bisection
import cvxpy.settings as s
from cvxpy.tests import base_test
import numpy as np
class TestDqcp(base_test.BaseTest):
def test_basic_with_interval(self):
x = cp.Variable()
expr = cp.ceil(x)
self.assertTrue(expr.is_dqcp())
... | true | true |
1c19b57717ec8349dd833e4dc6d996e27e9dfabb | 2,415 | py | Python | calvin/actorstore/systemactors/net/MQTTPublisher.py | gabrielcercel/calvin-base | c0315f100643230d65aed1745e1c22df3e7a7c2c | [
"Apache-2.0"
] | 334 | 2015-06-04T15:14:28.000Z | 2022-02-09T11:14:17.000Z | calvin/actorstore/systemactors/net/MQTTPublisher.py | gabrielcercel/calvin-base | c0315f100643230d65aed1745e1c22df3e7a7c2c | [
"Apache-2.0"
] | 89 | 2015-06-13T19:15:35.000Z | 2019-12-03T19:23:20.000Z | calvin/actorstore/systemactors/net/MQTTPublisher.py | gabrielcercel/calvin-base | c0315f100643230d65aed1745e1c22df3e7a7c2c | [
"Apache-2.0"
] | 112 | 2015-06-06T19:16:54.000Z | 2020-10-19T01:27:55.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2016 Ericsson AB
#
# 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 ... | 32.2 | 98 | 0.616149 |
from calvin.actor.actor import Actor, manage, condition, calvinsys, stateguard
from calvin.utilities.calvinlogger import get_logger
_log = get_logger(__name__)
class MQTTPublisher(Actor):
@manage(['mqtt'])
def init(self, hostname, port, settings):
if not settings:
settin... | true | true |
1c19b5d28468175ac176461c9a9abd29c292ac1a | 8,652 | py | Python | torchrec/distributed/sharding/cw_sharding.py | RabbitWhite1/torchrec | 031bcca5300d52099eb7490ff06fe0301c1c02f2 | [
"BSD-3-Clause"
] | 1 | 2022-03-27T14:04:45.000Z | 2022-03-27T14:04:45.000Z | torchrec/distributed/sharding/cw_sharding.py | RabbitWhite1/torchrec | 031bcca5300d52099eb7490ff06fe0301c1c02f2 | [
"BSD-3-Clause"
] | 1 | 2022-03-15T10:54:51.000Z | 2022-03-15T10:54:51.000Z | torchrec/distributed/sharding/cw_sharding.py | RabbitWhite1/torchrec | 031bcca5300d52099eb7490ff06fe0301c1c02f2 | [
"BSD-3-Clause"
] | 1 | 2022-02-09T23:52:22.000Z | 2022-02-09T23:52:22.000Z | #!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
from typing import Set, Callable, Dict, List, Optional, Tuple, TypeVar, Any
import torc... | 36.817021 | 88 | 0.635691 |
from typing import Set, Callable, Dict, List, Optional, Tuple, TypeVar, Any
import torch
import torch.distributed as dist
from fbgemm_gpu.permute_pooled_embedding_modules import PermutePooledEmbeddings
from torchrec.distributed.embedding_lookup import GroupedPooledEmbeddingsLookup
from torchrec.distributed.em... | true | true |
1c19b61033545840a778e5df536a92786272389c | 3,150 | py | Python | test/python/classical_function_compiler/test_boolean_expression.py | Roshan-Thomas/qiskit-terra | 77219b5c7b7146b1545c5e5190739b36f4064b2f | [
"Apache-2.0"
] | 1,599 | 2018-07-10T10:59:12.000Z | 2022-03-31T23:56:25.000Z | test/python/classical_function_compiler/test_boolean_expression.py | Roshan-Thomas/qiskit-terra | 77219b5c7b7146b1545c5e5190739b36f4064b2f | [
"Apache-2.0"
] | 5,244 | 2018-07-10T06:20:13.000Z | 2022-03-31T22:18:48.000Z | test/python/classical_function_compiler/test_boolean_expression.py | Roshan-Thomas/qiskit-terra | 77219b5c7b7146b1545c5e5190739b36f4064b2f | [
"Apache-2.0"
] | 1,409 | 2018-07-10T02:16:12.000Z | 2022-03-31T09:01:32.000Z | # This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | 32.142857 | 81 | 0.636825 |
import unittest
from os import path
from ddt import ddt, unpack, data
from qiskit.test.base import QiskitTestCase
from qiskit import execute, BasicAer
from qiskit.circuit.classicalfunction.boolean_expression import BooleanExpression
@ddt
class TestBooleanExpression(QiskitTestCase):
@data(
(... | true | true |
1c19b6ad4b3a0f99c64b69294bc5a59d1a88cc5e | 5,427 | py | Python | research/object_detection/dataset_tools/oid_geotagged_tfrecord_creation.py | ecreager/models | dafed92d823dee3ee8f176ee52288554df30220d | [
"Apache-2.0"
] | null | null | null | research/object_detection/dataset_tools/oid_geotagged_tfrecord_creation.py | ecreager/models | dafed92d823dee3ee8f176ee52288554df30220d | [
"Apache-2.0"
] | null | null | null | research/object_detection/dataset_tools/oid_geotagged_tfrecord_creation.py | ecreager/models | dafed92d823dee3ee8f176ee52288554df30220d | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 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... | 45.991525 | 80 | 0.711811 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
from object_detection.core import standard_fields
from object_detection.utils import dataset_util
def tf_example_from_annotations_data_frame(annotations_data_frame, labe... | true | true |
1c19b74cfb523afb497098cf931aea1842bd67d4 | 5,489 | py | Python | run_compilation.py | sr9000/stepik_code_task_baking | 60a5197f659db1734132eeb9d82624f1b7aaeb3f | [
"MIT"
] | null | null | null | run_compilation.py | sr9000/stepik_code_task_baking | 60a5197f659db1734132eeb9d82624f1b7aaeb3f | [
"MIT"
] | null | null | null | run_compilation.py | sr9000/stepik_code_task_baking | 60a5197f659db1734132eeb9d82624f1b7aaeb3f | [
"MIT"
] | null | null | null | import ast
import logging as log
import sys
from importlib import import_module
from inspect import getfile, getmodule
from itertools import filterfalse
from pathlib import Path
from runpy import run_path
from typing import Type, Iterable
from astunparse import unparse
from extra.introspection import collect_datasets... | 26.906863 | 115 | 0.648752 | import ast
import logging as log
import sys
from importlib import import_module
from inspect import getfile, getmodule
from itertools import filterfalse
from pathlib import Path
from runpy import run_path
from typing import Type, Iterable
from astunparse import unparse
from extra.introspection import collect_datasets... | true | true |
1c19b7e00dd86cd83380b6c3ac0af676da744be2 | 1,741 | py | Python | src/engine/SCons/Tool/default.py | EmanueleCannizzaro/scons | 6baa4e65cdf4df6951473545b69435711864e509 | [
"MIT"
] | 1 | 2019-09-18T06:37:02.000Z | 2019-09-18T06:37:02.000Z | src/engine/SCons/Tool/default.py | EmanueleCannizzaro/scons | 6baa4e65cdf4df6951473545b69435711864e509 | [
"MIT"
] | null | null | null | src/engine/SCons/Tool/default.py | EmanueleCannizzaro/scons | 6baa4e65cdf4df6951473545b69435711864e509 | [
"MIT"
] | null | null | null | """SCons.Tool.default
Initialization with a default tool list.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001 - 2016 The SCons Foundation
#
# Permission is hereby granted, free of cha... | 34.137255 | 106 | 0.755313 |
__revision__ = "src/engine/SCons/Tool/default.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog"
import SCons.Tool
def generate(env):
for t in SCons.Tool.tool_list(env['PLATFORM'], env):
SCons.Tool.Tool(t)(env)
def exists(env):
return 1
| true | true |
1c19b9bd3da7fc7f1014733d829cd86c84db0a3b | 30,204 | py | Python | gseapy/algorithm.py | juiyuliao/GSEA | edf0e7ace73791d425a1d5934834ac7bb8306c05 | [
"BSD-3-Clause"
] | null | null | null | gseapy/algorithm.py | juiyuliao/GSEA | edf0e7ace73791d425a1d5934834ac7bb8306c05 | [
"BSD-3-Clause"
] | null | null | null | gseapy/algorithm.py | juiyuliao/GSEA | edf0e7ace73791d425a1d5934834ac7bb8306c05 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import sys, logging
import numpy as np
#from functools import reduce
#from multiprocessing import Pool
from math import ceil
from gseapy.stats import multiple_testing_correction
from joblib import delayed, Parallel
def enrichment_score(gene_list, correl_vector, gene_set, weighted_score_type=1... | 45.215569 | 141 | 0.605284 |
import sys, logging
import numpy as np
from math import ceil
from gseapy.stats import multiple_testing_correction
from joblib import delayed, Parallel
def enrichment_score(gene_list, correl_vector, gene_set, weighted_score_type=1,
nperm=1000, rs=None, single=False, scale=False):
N = len(... | true | true |
1c19ba22affab587de396fe32daa430e268bf392 | 8,667 | py | Python | benchmarks/f3_wrong_hints_permutations/scaling_software_termination/19-2Nested_false-termination_15.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | 3 | 2021-04-23T23:29:26.000Z | 2022-03-23T10:00:30.000Z | benchmarks/f3_wrong_hints_permutations/scaling_software_termination/19-2Nested_false-termination_15.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | null | null | null | benchmarks/f3_wrong_hints_permutations/scaling_software_termination/19-2Nested_false-termination_15.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | 1 | 2021-11-17T22:02:56.000Z | 2021-11-17T22:02:56.000Z | from typing import Tuple, FrozenSet
from pysmt.environment import Environment as PysmtEnv
from pysmt.fnode import FNode
import pysmt.typing as types
from utils import symb_to_next
from hint import Hint, Location
def transition_system(env: PysmtEnv) -> Tuple[FrozenSet[FNode], FNode, FNode,
... | 31.516364 | 77 | 0.590747 | from typing import Tuple, FrozenSet
from pysmt.environment import Environment as PysmtEnv
from pysmt.fnode import FNode
import pysmt.typing as types
from utils import symb_to_next
from hint import Hint, Location
def transition_system(env: PysmtEnv) -> Tuple[FrozenSet[FNode], FNode, FNode,
... | true | true |
1c19bdbc619973fe19a88dbc0e2075c79ff99f98 | 2,593 | py | Python | ver1_0/openassembly/pirate_sources/models.py | fragro/Open-Assembly | e9679ff5e7ae9881fa5781d763288ed2f40b014d | [
"BSD-3-Clause"
] | 1 | 2015-11-05T08:22:19.000Z | 2015-11-05T08:22:19.000Z | ver1_0/openassembly/pirate_sources/models.py | fragro/Open-Assembly | e9679ff5e7ae9881fa5781d763288ed2f40b014d | [
"BSD-3-Clause"
] | null | null | null | ver1_0/openassembly/pirate_sources/models.py | fragro/Open-Assembly | e9679ff5e7ae9881fa5781d763288ed2f40b014d | [
"BSD-3-Clause"
] | 1 | 2018-02-03T18:25:41.000Z | 2018-02-03T18:25:41.000Z | from django.db import models
from django.contrib import admin
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
from django.contrib.auth.models import User
from django.utils.translation import ugettext as _
from StringIO import StringIO
from django.core.files.u... | 38.132353 | 107 | 0.691863 | from django.db import models
from django.contrib import admin
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
from django.contrib.auth.models import User
from django.utils.translation import ugettext as _
from StringIO import StringIO
from django.core.files.u... | false | true |
1c19bea9b1a619425b88351d0ae09d0f22bd8ca7 | 1,480 | py | Python | project/kay/utils/flash.py | yosukesuzuki/let-me-notify | 39f50214403822712329c1cd953167d6e9b315d6 | [
"MIT"
] | 1 | 2020-09-13T06:56:22.000Z | 2020-09-13T06:56:22.000Z | project/kay/utils/flash.py | yosukesuzuki/let-me-notify | 39f50214403822712329c1cd953167d6e9b315d6 | [
"MIT"
] | null | null | null | project/kay/utils/flash.py | yosukesuzuki/let-me-notify | 39f50214403822712329c1cd953167d6e9b315d6 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
kay.utils.flash
:Copyright: (c) 2009 tipfy.org,
Takashi Matsuo <tmatsuo@candit.jp>
All rights reserved.
:license: BSD, see LICENSE for more details.
"""
from base64 import b64encode, b64decode
import pickle
from kay.conf import settings
from kay.utils import... | 25.084746 | 77 | 0.687162 |
from base64 import b64encode, b64decode
import pickle
from kay.conf import settings
from kay.utils import local
from kay.i18n import lazy_gettext as _
def get_flash():
key = settings.FLASH_COOKIE_NAME
data = getattr(local, 'flash_message', None)
if data is None:
if key in local.request.cookies:
data ... | true | true |
1c19bf103627e2b66a24a6b5dcddf1ee890b5a11 | 2,276 | py | Python | judged/interned.py | utdb/judged | 383c08df1ded265ff26c344e1df2f1a623ffe86d | [
"MIT"
] | 20 | 2015-12-26T12:58:14.000Z | 2021-07-31T21:34:00.000Z | judged/interned.py | utdb/judged | 383c08df1ded265ff26c344e1df2f1a623ffe86d | [
"MIT"
] | null | null | null | judged/interned.py | utdb/judged | 383c08df1ded265ff26c344e1df2f1a623ffe86d | [
"MIT"
] | 5 | 2016-12-22T18:49:48.000Z | 2020-12-29T07:47:58.000Z | """
This module allows the creation of internalized classes. An internalized class
has only a single instance for each key used in its instantiation, allowing
very fast equality tests and hashing.
This implementation is based on a metaclass approach to prevent instancing of
already interned values.
A contrived exampl... | 33.470588 | 79 | 0.675308 |
import weakref
class Interned:
def __eq__(self, other):
return self is other
def __ne__(self, other):
return self is not other
def __hash__(self):
return id(self)
class InternalizeMeta(type):
def __new__(cls, name, bases, namespace, **kwargs):
interned_bases = base... | true | true |
1c19bfcde61fbd0e1a3ce86d2a155b98384b3f56 | 1,498 | py | Python | buildhat/hat.py | tomek-l/python-build-hat | 9f0b2e2c97cc4ab747c1a6031519d61f3950d232 | [
"MIT"
] | null | null | null | buildhat/hat.py | tomek-l/python-build-hat | 9f0b2e2c97cc4ab747c1a6031519d61f3950d232 | [
"MIT"
] | null | null | null | buildhat/hat.py | tomek-l/python-build-hat | 9f0b2e2c97cc4ab747c1a6031519d61f3950d232 | [
"MIT"
] | null | null | null | from .serinterface import BuildHAT
from .devices import Device
import os
import sys
import weakref
class Hat:
"""Allows enumeration of devices which are connected to the hat
"""
def __init__(self):
if not Device._instance:
data = os.path.join(os.path.dirname(sys.modules["buildhat"].__fi... | 35.666667 | 96 | 0.565421 | from .serinterface import BuildHAT
from .devices import Device
import os
import sys
import weakref
class Hat:
def __init__(self):
if not Device._instance:
data = os.path.join(os.path.dirname(sys.modules["buildhat"].__file__),"data/")
firm = os.path.join(data,"firmware.bin")
... | true | true |
1c19c0f258a51efc0341b321fe5f08161e09ead1 | 2,486 | py | Python | docs/conf.py | maulanailyasy/miepythonscot | acc28b5f6e041feef83dbe3bceb711a95c1ae37a | [
"MIT"
] | null | null | null | docs/conf.py | maulanailyasy/miepythonscot | acc28b5f6e041feef83dbe3bceb711a95c1ae37a | [
"MIT"
] | null | null | null | docs/conf.py | maulanailyasy/miepythonscot | acc28b5f6e041feef83dbe3bceb711a95c1ae37a | [
"MIT"
] | null | null | null | # If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys
import sphinx_rtd_theme
sys.path.insert(0, os.path.abspath... | 30.691358 | 79 | 0.697908 |
import os
import sys
import sphinx_rtd_theme
sys.path.insert(0, os.path.abspath('.'))
sys.path.insert(0, os.path.abspath('..'))
project = 'miepython'
copyright = '2017-21, Scott Prahl'
author = 'Scott Prahl'
release = '2.2.1'
master_doc = 'index'
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext... | true | true |
1c19c142c38807d84953b53fe13cb3c0862b7d8f | 1,636 | py | Python | profiles_api/models.py | PavitraKailash/profiles-rest-api | 8c71497a6fe4df6b700e952da5c4d2d26402e59c | [
"MIT"
] | null | null | null | profiles_api/models.py | PavitraKailash/profiles-rest-api | 8c71497a6fe4df6b700e952da5c4d2d26402e59c | [
"MIT"
] | null | null | null | profiles_api/models.py | PavitraKailash/profiles-rest-api | 8c71497a6fe4df6b700e952da5c4d2d26402e59c | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import AbstractBaseUser
from django.contrib.auth.models import PermissionsMixin
from django.contrib.auth.models import BaseUserManager
class UserProfileManager(BaseUserManager):
""" Manager for User profiles"""
def create_user(self, email, name, pa... | 27.266667 | 61 | 0.673594 | from django.db import models
from django.contrib.auth.models import AbstractBaseUser
from django.contrib.auth.models import PermissionsMixin
from django.contrib.auth.models import BaseUserManager
class UserProfileManager(BaseUserManager):
def create_user(self, email, name, password=None):
if not email:
... | true | true |
1c19c1f4c8a6d8d32b912d704d4dbec7e108ab6f | 1,314 | py | Python | simRegistration/migrations/0001_initial.py | Musbell/iwbsrs | ea7343361027ca877f61903d553ce01504840e8c | [
"MIT"
] | null | null | null | simRegistration/migrations/0001_initial.py | Musbell/iwbsrs | ea7343361027ca877f61903d553ce01504840e8c | [
"MIT"
] | 10 | 2020-03-24T15:36:11.000Z | 2022-01-13T00:41:38.000Z | simRegistration/migrations/0001_initial.py | Musbell/iwbsrs | ea7343361027ca877f61903d553ce01504840e8c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-07-31 07:46
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('mobile... | 34.578947 | 135 | 0.627093 |
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('mobileNetworks', '0002_auto_20170722_1138'),
migrations.swappable_dep... | true | true |
1c19c4a46568180eb26895bb10ae3e8db2b8a8e5 | 43,193 | py | Python | run_token_level_classifier_multigpus.py | flyliu2017/bert | cc6e676ff8693a6cc31ade9d7a6cbb0789d7877c | [
"Apache-2.0"
] | 1 | 2019-10-19T20:14:39.000Z | 2019-10-19T20:14:39.000Z | run_token_level_classifier_multigpus.py | flyliu2017/bert | cc6e676ff8693a6cc31ade9d7a6cbb0789d7877c | [
"Apache-2.0"
] | null | null | null | run_token_level_classifier_multigpus.py | flyliu2017/bert | cc6e676ff8693a6cc31ade9d7a6cbb0789d7877c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 The Google AI Language Team 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 ... | 37.955185 | 123 | 0.625912 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import csv
import os
from tensorflow.python.ops.losses.losses_impl import Reduction
import modeling
import optimization_multigpus
import tokenization
import tensorflow as tf
... | true | true |
1c19c594eb7191ef64ca8ba04c6aac194e95c805 | 3,507 | py | Python | EE210 - Assignment 1/fft_pkg.py | PrieureDeSion/ee210-assignments | cc67a40f6142862e8a01003c479b2d5ca50d7e05 | [
"Unlicense"
] | null | null | null | EE210 - Assignment 1/fft_pkg.py | PrieureDeSion/ee210-assignments | cc67a40f6142862e8a01003c479b2d5ca50d7e05 | [
"Unlicense"
] | null | null | null | EE210 - Assignment 1/fft_pkg.py | PrieureDeSion/ee210-assignments | cc67a40f6142862e8a01003c479b2d5ca50d7e05 | [
"Unlicense"
] | null | null | null | from cmath import exp, pi
from math import ceil, log, modf
import numpy as np
def extend_domain(sound, N):
n = N - 1
if not (modf(log(n, 2))[0] == 0.0):
sound.extend([0] * int(2**(ceil(log(n, 2))) - len(sound)))
def fft_i(sequence):
# Cooley - Tuckey Algorithm
seq = list(sequence)
N = len(seq)
threshold = 16... | 26.770992 | 91 | 0.609353 | from cmath import exp, pi
from math import ceil, log, modf
import numpy as np
def extend_domain(sound, N):
n = N - 1
if not (modf(log(n, 2))[0] == 0.0):
sound.extend([0] * int(2**(ceil(log(n, 2))) - len(sound)))
def fft_i(sequence):
seq = list(sequence)
N = len(seq)
threshold = 16
if N <= threshold:
retu... | false | true |
1c19c5b61dfc7bf7bd4858d98c3d6c2c9ab56a34 | 24,477 | py | Python | ch18/ticTacToeTests.py | Excalibur95/eneticAlgorithmsWithPython | 9ab98edd04d5d06277f57e1e9edcb72ba6a43828 | [
"Apache-2.0"
] | 1 | 2017-12-28T02:45:41.000Z | 2017-12-28T02:45:41.000Z | ch18/ticTacToeTests.py | zzw95/GeneticAlgorithmsWithPython | 9ab98edd04d5d06277f57e1e9edcb72ba6a43828 | [
"Apache-2.0"
] | null | null | null | ch18/ticTacToeTests.py | zzw95/GeneticAlgorithmsWithPython | 9ab98edd04d5d06277f57e1e9edcb72ba6a43828 | [
"Apache-2.0"
] | 1 | 2021-04-18T23:34:11.000Z | 2021-04-18T23:34:11.000Z | # File: ticTacToeTests.py
# from chapter 18 of _Genetic Algorithms with Python_
#
# Author: Clinton Sheppard <fluentcoder@gmail.com>
# Copyright (c) 2016 Clinton Sheppard
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# You may o... | 33.211669 | 96 | 0.599216 |
import datetime
import random
import unittest
from functools import partial
import genetic
def get_fitness(genes):
localCopy = genes[:]
fitness = get_fitness_for_games(localCopy)
fitness.GeneCount = len(genes)
return fitness
squareIndexes = [1, 2, 3, 4, 5, 6, 7, 8, 9]
def play1on... | true | true |
1c19c6253d90b63f8fedc4886dbbb54108e1a7f5 | 50,099 | py | Python | scipy/optimize/zeros.py | chrisvalx/scipy | 41f812e6aafd9b5698c56ef17d175da223bd6b76 | [
"BSD-3-Clause"
] | 1 | 2021-03-28T14:48:14.000Z | 2021-03-28T14:48:14.000Z | scipy/optimize/zeros.py | chrisvalx/scipy | 41f812e6aafd9b5698c56ef17d175da223bd6b76 | [
"BSD-3-Clause"
] | 1 | 2021-02-28T01:31:39.000Z | 2021-02-28T01:31:39.000Z | scipy/optimize/zeros.py | chrisvalx/scipy | 41f812e6aafd9b5698c56ef17d175da223bd6b76 | [
"BSD-3-Clause"
] | null | null | null | import warnings
from collections import namedtuple
import operator
from . import _zeros
import numpy as np
_iter = 100
_xtol = 2e-12
_rtol = 4 * np.finfo(float).eps
__all__ = ['newton', 'bisect', 'ridder', 'brentq', 'brenth', 'toms748',
'RootResults']
# Must agree with CONVERGED, SIGNERR, CONVERR, ... i... | 36.702564 | 83 | 0.574363 | import warnings
from collections import namedtuple
import operator
from . import _zeros
import numpy as np
_iter = 100
_xtol = 2e-12
_rtol = 4 * np.finfo(float).eps
__all__ = ['newton', 'bisect', 'ridder', 'brentq', 'brenth', 'toms748',
'RootResults']
_ECONVERGED = 0
_ESIGNERR = -1
_ECONVERR = -2
_EVALU... | true | true |
1c19c722d18d50793673feeb84991965a6fa420f | 996 | py | Python | estado civil.py | andrade-lcs/ex_curso_em_video_python | f2d029efe7a20cdf0fcb5b602f9992e27d37c263 | [
"MIT"
] | null | null | null | estado civil.py | andrade-lcs/ex_curso_em_video_python | f2d029efe7a20cdf0fcb5b602f9992e27d37c263 | [
"MIT"
] | null | null | null | estado civil.py | andrade-lcs/ex_curso_em_video_python | f2d029efe7a20cdf0fcb5b602f9992e27d37c263 | [
"MIT"
] | null | null | null | lista = ('casada', 'solteira', 'separada', 'viuva')
p_cas = 0
p_sol = 0
p_sep = 0
p_viu = 0
while True:
idade = int(input('Digite a idade: '))
if idade == 0:
break
est_civ = input('Digite o estado civil: ').strip().lower()
while est_civ not in lista:
print('\033[31mEstado civil errado, d... | 30.181818 | 82 | 0.613454 | lista = ('casada', 'solteira', 'separada', 'viuva')
p_cas = 0
p_sol = 0
p_sep = 0
p_viu = 0
while True:
idade = int(input('Digite a idade: '))
if idade == 0:
break
est_civ = input('Digite o estado civil: ').strip().lower()
while est_civ not in lista:
print('\033[31mEstado civil errado, d... | true | true |
1c19c7740d1e09931108202481619646633fd72c | 5,144 | py | Python | aioelasticsearch/connection.py | vonschlager/aioelasticsearch | a9a492f1f90b28fb732e123a9149f0cc87ff4477 | [
"MIT"
] | null | null | null | aioelasticsearch/connection.py | vonschlager/aioelasticsearch | a9a492f1f90b28fb732e123a9149f0cc87ff4477 | [
"MIT"
] | null | null | null | aioelasticsearch/connection.py | vonschlager/aioelasticsearch | a9a492f1f90b28fb732e123a9149f0cc87ff4477 | [
"MIT"
] | 1 | 2018-10-05T12:13:28.000Z | 2018-10-05T12:13:28.000Z | import asyncio
from distutils.version import StrictVersion
import aiohttp
from .exceptions import ConnectionError, ConnectionTimeout, SSLError # noqa # isort:skip
from elasticsearch.connection import Connection # noqa # isort:skip
from yarl import URL # noqa # isort:skip
class AIOHttpConnection(Connection):
... | 28.73743 | 89 | 0.49203 | import asyncio
from distutils.version import StrictVersion
import aiohttp
from .exceptions import ConnectionError, ConnectionTimeout, SSLError icsearch.connection import Connection mport URL HttpConnection(Connection):
def __init__(
self,
host='localhost',
port=9200,
http_auth=... | true | true |
1c19c8be47609f8409c81d7aac8f214a763cd92d | 11,105 | py | Python | huaweicloud-sdk-iec/huaweicloudsdkiec/v1/model/os_extra_specs.py | wuchen-huawei/huaweicloud-sdk-python-v3 | 3683d703f4320edb2b8516f36f16d485cff08fc2 | [
"Apache-2.0"
] | 1 | 2021-11-03T07:54:50.000Z | 2021-11-03T07:54:50.000Z | huaweicloud-sdk-iec/huaweicloudsdkiec/v1/model/os_extra_specs.py | wuchen-huawei/huaweicloud-sdk-python-v3 | 3683d703f4320edb2b8516f36f16d485cff08fc2 | [
"Apache-2.0"
] | null | null | null | huaweicloud-sdk-iec/huaweicloudsdkiec/v1/model/os_extra_specs.py | wuchen-huawei/huaweicloud-sdk-python-v3 | 3683d703f4320edb2b8516f36f16d485cff08fc2 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
import pprint
import re
import six
class OsExtraSpecs:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is js... | 31.370056 | 279 | 0.651959 |
import pprint
import re
import six
class OsExtraSpecs:
sensitive_list = []
openapi_types = {
'condoperationstatus': 'str',
'ecsgeneration': 'str',
'ecsperformance_type': 'str',
'ecsvirtualization_env_types': 'str',
'info_cpu_name': 'str',
'info_gpu_nam... | true | true |
1c19c8ce3b2cf74a6fc88b9cb7104fee4877e937 | 5,367 | py | Python | vulcan/_api.py | Antoni-Czaplicki/vulcan-api | a1d9127ce156013a7a803f31b55591989f05ba5a | [
"MIT"
] | 1 | 2021-01-08T00:23:27.000Z | 2021-01-08T00:23:27.000Z | vulcan/_api.py | Antoni-Czaplicki/vulcan-api | a1d9127ce156013a7a803f31b55591989f05ba5a | [
"MIT"
] | null | null | null | vulcan/_api.py | Antoni-Czaplicki/vulcan-api | a1d9127ce156013a7a803f31b55591989f05ba5a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import json
from typing import Union
import aiohttp
from uonet_request_signer_hebe import get_signature_values
from yarl import URL
from ._api_helper import ApiHelper
from ._keystore import Keystore
from ._utils import (
APP_NAME,
APP_OS,
APP_USER_AGENT,
APP_VERSION,
Vulca... | 30.151685 | 85 | 0.578535 |
import json
from typing import Union
import aiohttp
from uonet_request_signer_hebe import get_signature_values
from yarl import URL
from ._api_helper import ApiHelper
from ._keystore import Keystore
from ._utils import (
APP_NAME,
APP_OS,
APP_USER_AGENT,
APP_VERSION,
VulcanAPIException,
log,... | true | true |
1c19c9525d5436a17a2ae7cda5dc5eae1922f1df | 16,571 | py | Python | sunpy/coordinates/tests/test_frames.py | dgarciabriseno/sunpy | 40f6d7d5ba9d63ac7ffd3ea8587642867caeae25 | [
"BSD-2-Clause"
] | null | null | null | sunpy/coordinates/tests/test_frames.py | dgarciabriseno/sunpy | 40f6d7d5ba9d63ac7ffd3ea8587642867caeae25 | [
"BSD-2-Clause"
] | null | null | null | sunpy/coordinates/tests/test_frames.py | dgarciabriseno/sunpy | 40f6d7d5ba9d63ac7ffd3ea8587642867caeae25 | [
"BSD-2-Clause"
] | null | null | null |
import warnings
import numpy as np
import pytest
import astropy.units as u
from astropy.coordinates import (
CartesianRepresentation,
SkyCoord,
SphericalRepresentation,
UnitSphericalRepresentation,
)
from astropy.tests.helper import assert_quantity_allclose
from sunpy import sun
from sunpy.coordinat... | 36.824444 | 105 | 0.622051 |
import warnings
import numpy as np
import pytest
import astropy.units as u
from astropy.coordinates import (
CartesianRepresentation,
SkyCoord,
SphericalRepresentation,
UnitSphericalRepresentation,
)
from astropy.tests.helper import assert_quantity_allclose
from sunpy import sun
from sunpy.coordinat... | true | true |
1c19ca4f7fc5873deb5ef69c982fb86a36cbbb7b | 637 | py | Python | gulpy/structure/labels/tests/test_dreiding.py | learningmatter-mit/gulpy | a1894a40392fd9fa95cdee06b0253b340add8f49 | [
"MIT"
] | 1 | 2021-05-27T18:39:45.000Z | 2021-05-27T18:39:45.000Z | gulpy/structure/labels/tests/test_dreiding.py | learningmatter-mit/gulpy | a1894a40392fd9fa95cdee06b0253b340add8f49 | [
"MIT"
] | null | null | null | gulpy/structure/labels/tests/test_dreiding.py | learningmatter-mit/gulpy | a1894a40392fd9fa95cdee06b0253b340add8f49 | [
"MIT"
] | 1 | 2022-01-16T19:15:29.000Z | 2022-01-16T19:15:29.000Z | import os
import unittest as ut
from pymatgen.core import Molecule
from gulpy.structure import GulpMolecule
from gulpy.structure.labels import DreidingMoleculeLabels
from gulpy.tests.test_files import load_structure, load_molecule
class TestDreiding(ut.TestCase):
def setUp(self):
self.pmgmol = load_molec... | 26.541667 | 81 | 0.701727 | import os
import unittest as ut
from pymatgen.core import Molecule
from gulpy.structure import GulpMolecule
from gulpy.structure.labels import DreidingMoleculeLabels
from gulpy.tests.test_files import load_structure, load_molecule
class TestDreiding(ut.TestCase):
def setUp(self):
self.pmgmol = load_molec... | true | true |
1c19ca71158c29ff9c04af7575466550800a59f8 | 2,742 | py | Python | pytracer/reflection/bdf/measured.py | zjiayao/pyTracer | c2b4ef299ecbdca1c519059488f7cd2438943ee4 | [
"MIT"
] | 9 | 2017-11-20T18:17:27.000Z | 2022-01-27T23:00:31.000Z | pytracer/reflection/bdf/measured.py | zjiayao/pyTracer | c2b4ef299ecbdca1c519059488f7cd2438943ee4 | [
"MIT"
] | 4 | 2021-06-08T19:03:51.000Z | 2022-03-11T23:18:44.000Z | pytracer/reflection/bdf/measured.py | zjiayao/pyTracer | c2b4ef299ecbdca1c519059488f7cd2438943ee4 | [
"MIT"
] | 1 | 2017-11-20T22:48:01.000Z | 2017-11-20T22:48:01.000Z | """
measured.py
pytracer.reflection.bdf package
Measured BRDF. Support brdf and MERL protocol.
TODO: Read MERL binaries.
Created by Jiayao on Aug 2, 2017
"""
from __future__ import absolute_import
from pytracer import *
import pytracer.geometry as geo
from pytracer.reflection.utility import (cos_phi, sin_phi, cos_... | 25.155963 | 95 | 0.657549 | from __future__ import absolute_import
from pytracer import *
import pytracer.geometry as geo
from pytracer.reflection.utility import (cos_phi, sin_phi, cos_theta, sin_theta, brdf_remap)
from pytracer.reflection.bdf.bdf import (BDFType, BDF)
__all__ = ['IrIsotropicBRDFSample', 'IrIsotropicBRDF', 'ReHalfangleBRDF']
... | true | true |
1c19cac13a6a9b2d014539984b94a35c377b31db | 930 | py | Python | postgresqleu/elections/admin.py | dlangille/pgeu-system | 3f1910010063bab118e94a55ed757b23f1d36bf5 | [
"MIT"
] | null | null | null | postgresqleu/elections/admin.py | dlangille/pgeu-system | 3f1910010063bab118e94a55ed757b23f1d36bf5 | [
"MIT"
] | null | null | null | postgresqleu/elections/admin.py | dlangille/pgeu-system | 3f1910010063bab118e94a55ed757b23f1d36bf5 | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.forms import ValidationError, ModelForm
from .models import Vote, Election, Candidate
class VoteAdminForm(ModelForm):
class Meta:
model = Vote
exclude = []
def clean(self):
raise ValidationError("You really shouldn't edit votes! If you *re... | 25.833333 | 127 | 0.694624 | from django.contrib import admin
from django.forms import ValidationError, ModelForm
from .models import Vote, Election, Candidate
class VoteAdminForm(ModelForm):
class Meta:
model = Vote
exclude = []
def clean(self):
raise ValidationError("You really shouldn't edit votes! If you *re... | true | true |
1c19cbec57f4882a5d833d4f9b5e017b717108c9 | 1,193 | py | Python | airflow/contrib/sensors/imap_attachment_sensor.py | dorranh/airflow | 1a9a2cadcf8606cfcb729d1323dd33dfacc64633 | [
"Apache-2.0"
] | null | null | null | airflow/contrib/sensors/imap_attachment_sensor.py | dorranh/airflow | 1a9a2cadcf8606cfcb729d1323dd33dfacc64633 | [
"Apache-2.0"
] | 1 | 2019-05-14T14:32:40.000Z | 2019-05-14T14:32:40.000Z | airflow/contrib/sensors/imap_attachment_sensor.py | dorranh/airflow | 1a9a2cadcf8606cfcb729d1323dd33dfacc64633 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | 39.766667 | 94 | 0.770327 |
import warnings
from airflow.providers.imap.sensors.imap_attachment import ImapAttachmentSensor
warnings.warn(
"This module is deprecated. Please use `airflow.providers.imap.sensors.imap_attachment`.",
DeprecationWarning, stacklevel=2
)
| true | true |
1c19cc0f5247f4173c6010b6e8fac20bc6fca8da | 22,120 | py | Python | LowLevelApi/NGPF/Python/SDN/PCEP/pcep_return_deligation_take_control.py | NickKeating/IxNetwork | 0a54c0b8d1a1664d2826ad20a826ef384c48432f | [
"MIT"
] | 46 | 2018-01-24T06:43:45.000Z | 2022-03-17T07:27:08.000Z | LowLevelApi/NGPF/Python/SDN/PCEP/pcep_return_deligation_take_control.py | NickKeating/IxNetwork | 0a54c0b8d1a1664d2826ad20a826ef384c48432f | [
"MIT"
] | 104 | 2018-03-16T18:16:29.000Z | 2022-03-17T07:16:43.000Z | LowLevelApi/NGPF/Python/SDN/PCEP/pcep_return_deligation_take_control.py | NickKeating/IxNetwork | 0a54c0b8d1a1664d2826ad20a826ef384c48432f | [
"MIT"
] | 58 | 2018-01-23T05:54:20.000Z | 2022-03-30T22:55:20.000Z |
################################################################################
# #
# LEGAL NOTICE: #
# ============== ... | 46.470588 | 92 | 0.463201 | false | true | |
1c19cc52ed952dcc5537e2b1dcce855fd9cf3689 | 31,285 | py | Python | rootfs/scheduler/resources/pod.py | topfreegames/controller | ff36b91c54c4d3d222137de1cf3dedf98037e106 | [
"MIT"
] | null | null | null | rootfs/scheduler/resources/pod.py | topfreegames/controller | ff36b91c54c4d3d222137de1cf3dedf98037e106 | [
"MIT"
] | 3 | 2018-03-15T13:42:45.000Z | 2019-04-16T21:40:38.000Z | rootfs/scheduler/resources/pod.py | topfreegames/controller | ff36b91c54c4d3d222137de1cf3dedf98037e106 | [
"MIT"
] | null | null | null | from collections import defaultdict
from datetime import datetime, timedelta
import operator
import os
import time
from scheduler.exceptions import KubeException, KubeHTTPException
from scheduler.resources import Resource
from scheduler.states import PodState
class Pod(Resource):
short_name = 'po'
def get(s... | 40.006394 | 184 | 0.574173 | from collections import defaultdict
from datetime import datetime, timedelta
import operator
import os
import time
from scheduler.exceptions import KubeException, KubeHTTPException
from scheduler.resources import Resource
from scheduler.states import PodState
class Pod(Resource):
short_name = 'po'
def get(s... | true | true |
1c19ccd24ed287c5ce8d49f9cd0c2afcc378b05e | 440 | py | Python | data/scripts/templates/object/static/item/shared_item_datapad_s2.py | obi-two/GameServer | 7d37024e2291a97d49522610cd8f1dbe5666afc2 | [
"MIT"
] | 20 | 2015-02-23T15:11:56.000Z | 2022-03-18T20:56:48.000Z | data/scripts/templates/object/static/item/shared_item_datapad_s2.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | null | null | null | data/scripts/templates/object/static/item/shared_item_datapad_s2.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | 20 | 2015-04-04T16:35:59.000Z | 2022-03-24T14:54:37.000Z | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Static()
result.template = "object/static/item/shared_item_datapad_s2.iff"
result.attribute_template_id = -1
res... | 25.882353 | 66 | 0.722727 | true | true | |
1c19cd8274e3027f69bd0525bf6688d873b75522 | 5,620 | py | Python | env/lib/python3.7/site-packages/docusign_monitor/models/web_query.py | davidgacc/docusign | e63167101656d0066d481844576ce687ea80eb91 | [
"MIT"
] | 1 | 2021-11-14T17:06:35.000Z | 2021-11-14T17:06:35.000Z | env/lib/python3.7/site-packages/docusign_monitor/models/web_query.py | davidgacc/docusign | e63167101656d0066d481844576ce687ea80eb91 | [
"MIT"
] | null | null | null | env/lib/python3.7/site-packages/docusign_monitor/models/web_query.py | davidgacc/docusign | e63167101656d0066d481844576ce687ea80eb91 | [
"MIT"
] | 1 | 2021-11-14T17:06:22.000Z | 2021-11-14T17:06:22.000Z | # coding: utf-8
"""
DocuSign Monitor API - v2
An API for an integrator to access the features of DocuSign Monitor # noqa: E501
OpenAPI spec version: v2.0
Contact: devcenter@docusign.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
... | 28.1 | 109 | 0.579004 |
import pprint
import re
import six
class WebQuery(object):
swagger_types = {
'filters': 'list[Filter]',
'aggregations': 'list[Aggregation]',
'query_scope': 'str',
'query_scope_id': 'str'
}
attribute_map = {
'filters': 'filters',
'aggregations': 'agg... | true | true |
1c19cde22ab2e67c10948ba117745b8c62715b79 | 1,809 | py | Python | ctree/codegen.py | mbdriscoll/ctree | e15538ecdf3aaa3bb2f210701d29334fd5e4ec40 | [
"BSD-2-Clause"
] | 3 | 2017-01-23T10:48:52.000Z | 2021-06-05T06:57:12.000Z | ctree/codegen.py | mbdriscoll/ctree | e15538ecdf3aaa3bb2f210701d29334fd5e4ec40 | [
"BSD-2-Clause"
] | 2 | 2016-03-11T22:32:01.000Z | 2018-10-17T17:35:50.000Z | ctree/codegen.py | mbdriscoll/ctree | e15538ecdf3aaa3bb2f210701d29334fd5e4ec40 | [
"BSD-2-Clause"
] | null | null | null | from __future__ import print_function
"""
base class for generating code appropriate to the selected backend
"""
from ctree.visitors import NodeVisitor
from ctree.util import flatten
class CodeGenVisitor(NodeVisitor):
"""
Return a string containing the program text.
"""
def __init__(self, indent=0):... | 31.736842 | 79 | 0.550028 | from __future__ import print_function
from ctree.visitors import NodeVisitor
from ctree.util import flatten
class CodeGenVisitor(NodeVisitor):
def __init__(self, indent=0):
self._indent = indent
def _tab(self):
return " " * self._indent
def _genblock(self, forest, insert_... | true | true |
1c19ce0fa8fcc52f07e18d05316e3440b5abc1b8 | 6,127 | py | Python | _server/python-gotenna/sdk/sampleDriver.py | andrzejgrabowski/riot-android | 7b793d0e22264e1b81cd5fb55641a8b95e4ab7ff | [
"Apache-2.0"
] | null | null | null | _server/python-gotenna/sdk/sampleDriver.py | andrzejgrabowski/riot-android | 7b793d0e22264e1b81cd5fb55641a8b95e4ab7ff | [
"Apache-2.0"
] | null | null | null | _server/python-gotenna/sdk/sampleDriver.py | andrzejgrabowski/riot-android | 7b793d0e22264e1b81cd5fb55641a8b95e4ab7ff | [
"Apache-2.0"
] | null | null | null | """
This sampleDriver is intended for a direct interaction with the goTenna SDK,
and uses a json file for the device configuration.
Usage: python sampleDriver -s settingFile.json [-m]
Copyright goTenna, Inc 2018
"""
import argparse
import code
import logging
import json
import os
import datetime
import sys
import u... | 37.820988 | 107 | 0.642729 |
import argparse
import code
import logging
import json
import os
import datetime
import sys
import uuid
import goTenna
logger = logging.getLogger(__name__)
def interact():
parser = argparse.ArgumentParser(description='Interact with a goTenna device')
def auto_int... | true | true |
1c19ce3bb2c50ad4da9c6b46ff86393c88f6727b | 7,683 | py | Python | src/charm.py | gmeszaros/charm-kamailio | 9346b864767d9defd2fe70079eac00af33b69cbe | [
"Apache-2.0"
] | 1 | 2021-11-29T17:46:13.000Z | 2021-11-29T17:46:13.000Z | src/charm.py | gmeszaros/charm-kamailio | 9346b864767d9defd2fe70079eac00af33b69cbe | [
"Apache-2.0"
] | null | null | null | src/charm.py | gmeszaros/charm-kamailio | 9346b864767d9defd2fe70079eac00af33b69cbe | [
"Apache-2.0"
] | 1 | 2022-01-19T16:33:51.000Z | 2022-01-19T16:33:51.000Z | #!/usr/bin/env python3
# Copyright 2021 Gabor Meszaros
# See LICENSE file for licensing details.
#
# Learn more at: https://juju.is/docs/sdk
"""Charm the service.
Refer to the following post for a quick-start guide that will help you
develop a new k8s charm using the Operator Framework:
https://discourse.charmhu... | 36.585714 | 97 | 0.626578 |
import logging
from charms.nginx_ingress_integrator.v0.ingress import IngressRequires
from ops.charm import CharmBase
from ops.framework import StoredState
from ops.main import main
from ops.model import ActiveStatus, BlockedStatus
from ops.pebble import ServiceStatus
logger = logging.getLogger(__name__)
cla... | true | true |
1c19cee72ebd571ff340cdd9e67dc9d8193625fa | 78,199 | py | Python | packages/python/plotly/plotly/graph_objs/icicle/marker/_colorbar.py | labaran1/plotly.py | 7ec751e8fed4a570c11ea4bea2231806389d62eb | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/graph_objs/icicle/marker/_colorbar.py | labaran1/plotly.py | 7ec751e8fed4a570c11ea4bea2231806389d62eb | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/graph_objs/icicle/marker/_colorbar.py | labaran1/plotly.py | 7ec751e8fed4a570c11ea4bea2231806389d62eb | [
"MIT"
] | null | null | null | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class ColorBar(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "icicle.marker"
_path_str = "icicle.marker.colorbar"
_valid_props = {
"bgcolor",
... | 36.086294 | 99 | 0.562437 | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class ColorBar(_BaseTraceHierarchyType):
_parent_path_str = "icicle.marker"
_path_str = "icicle.marker.colorbar"
_valid_props = {
"bgcolor",
"bordercolor",
"borderwidt... | true | true |
1c19cf00afec7548b31b7cc88bbc4c1776a16304 | 17,810 | py | Python | log_mito_bcl2/model_286.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | log_mito_bcl2/model_286.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | log_mito_bcl2/model_286.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | # exported from PySB model 'model'
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('Ligand', ['Receptor'])
Monomer('ParpU', ['C3A'])
Monomer('C8A', ['BidU'])
Monomer('SmacM', ['BaxA'])
Monomer('BaxM', ['BidM', 'BaxA'])
M... | 92.279793 | 798 | 0.801011 |
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('Ligand', ['Receptor'])
Monomer('ParpU', ['C3A'])
Monomer('C8A', ['BidU'])
Monomer('SmacM', ['BaxA'])
Monomer('BaxM', ['BidM', 'BaxA'])
Monomer('Apop', ['C3pro', 'Xiap'])
... | true | true |
1c19cf740396eedf4ef1c1246ae9ceccb87cebfb | 3,803 | py | Python | sandbox/apps/python/img_proc/unsharp_mask/builder.py | rcodin/polymage | 653487be125dec4950d1c65da4f736fa05fb938f | [
"Apache-2.0"
] | null | null | null | sandbox/apps/python/img_proc/unsharp_mask/builder.py | rcodin/polymage | 653487be125dec4950d1c65da4f736fa05fb938f | [
"Apache-2.0"
] | null | null | null | sandbox/apps/python/img_proc/unsharp_mask/builder.py | rcodin/polymage | 653487be125dec4950d1c65da4f736fa05fb938f | [
"Apache-2.0"
] | null | null | null | from __init__ import *
import sys
import subprocess
sys.path.insert(0, ROOT+'apps/python/')
from cpp_compiler import c_compile
from loader import load_lib
from polymage_unsharp_mask import unsharp_mask
from compiler import *
from constructs import *
def codegen(pipe, file_name, app_data):
print("")
print("... | 27.759124 | 78 | 0.586116 | from __init__ import *
import sys
import subprocess
sys.path.insert(0, ROOT+'apps/python/')
from cpp_compiler import c_compile
from loader import load_lib
from polymage_unsharp_mask import unsharp_mask
from compiler import *
from constructs import *
def codegen(pipe, file_name, app_data):
print("")
print("... | true | true |
1c19cfc1815917df906c586a2b2836e3c23b264d | 12,595 | py | Python | biosppy/signals/eeg.py | Feverdreams/BMI | 243373de42409ff11fff62af22703c2ed57c08c2 | [
"BSD-3-Clause"
] | 1 | 2020-07-03T19:16:01.000Z | 2020-07-03T19:16:01.000Z | biosppy/signals/eeg.py | hiris25/BioSPPy | 53d59f996f21ad29bf2e8961eb9b45bfe1776252 | [
"BSD-3-Clause"
] | null | null | null | biosppy/signals/eeg.py | hiris25/BioSPPy | 53d59f996f21ad29bf2e8961eb9b45bfe1776252 | [
"BSD-3-Clause"
] | 1 | 2019-11-20T08:33:13.000Z | 2019-11-20T08:33:13.000Z | # -*- coding: utf-8 -*-
"""
biosppy.signals.eeg
-------------------
This module provides methods to process Electroencephalographic (EEG)
signals.
:copyright: (c) 2015-2018 by Instituto de Telecomunicacoes
:license: BSD 3-clause, see LICENSE for more details.
"""
# Imports
# compat
from __future__ import absolute_im... | 28.495475 | 80 | 0.545375 |
from __future__ import absolute_import, division, print_function
from six.moves import range
import numpy as np
from . import tools as st
from .. import plotting, utils
def eeg(signal=None, sampling_rate=1000., labels=None, show=True):
if signal is None:
raise TypeError("Please specify an in... | true | true |
1c19d01312a9052dbfc6beef40a4d89b5b38ba49 | 7,600 | py | Python | salt-2016.3.3/salt/utils/s3.py | stephane-martin/salt-debian-packaging | 4ec73750ba67bfe35a5bc0faa110f2bdec5c6a66 | [
"Apache-2.0"
] | null | null | null | salt-2016.3.3/salt/utils/s3.py | stephane-martin/salt-debian-packaging | 4ec73750ba67bfe35a5bc0faa110f2bdec5c6a66 | [
"Apache-2.0"
] | null | null | null | salt-2016.3.3/salt/utils/s3.py | stephane-martin/salt-debian-packaging | 4ec73750ba67bfe35a5bc0faa110f2bdec5c6a66 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Connection library for Amazon S3
:depends: requests
'''
from __future__ import absolute_import
# Import Python libs
import logging
# Import 3rd-party libs
try:
import requests
HAS_REQUESTS = True # pylint: disable=W0612
except ImportError:
HAS_REQUESTS = False # pylint: disa... | 33.628319 | 82 | 0.547237 |
from __future__ import absolute_import
import logging
try:
import requests
HAS_REQUESTS = True
except ImportError:
HAS_REQUESTS = False
import salt.utils
import salt.utils.aws
import salt.utils.xmlutil as xml
from salt._compat import ElementTree as ET
log = logging.getLogger(__name__)
def quer... | true | true |
1c19d09a1624863b3847538b35126759c0ec981f | 1,281 | py | Python | _unittests/ut_ipythonhelper/test_cache_urls.py | Pandinosaurus/pyquickhelper | 326276f656cf88989e4d0fcd006ada0d3735bd9e | [
"MIT"
] | 18 | 2015-11-10T08:09:23.000Z | 2022-02-16T11:46:45.000Z | _unittests/ut_ipythonhelper/test_cache_urls.py | Pandinosaurus/pyquickhelper | 326276f656cf88989e4d0fcd006ada0d3735bd9e | [
"MIT"
] | 321 | 2015-06-14T21:34:28.000Z | 2021-11-28T17:10:03.000Z | _unittests/ut_ipythonhelper/test_cache_urls.py | Pandinosaurus/pyquickhelper | 326276f656cf88989e4d0fcd006ada0d3735bd9e | [
"MIT"
] | 10 | 2015-06-20T01:35:00.000Z | 2022-01-19T15:54:32.000Z | """
@brief test log(time=10s)
notebook test
"""
import sys
import os
import unittest
import pyquickhelper
from pyquickhelper.loghelper import fLOG
from pyquickhelper.pycode import get_temp_folder
from pyquickhelper.pycode import is_travis_or_appveyor
from pyquickhelper.ipythonhelper import execute_notebook_list... | 29.113636 | 96 | 0.676034 |
import sys
import os
import unittest
import pyquickhelper
from pyquickhelper.loghelper import fLOG
from pyquickhelper.pycode import get_temp_folder
from pyquickhelper.pycode import is_travis_or_appveyor
from pyquickhelper.ipythonhelper import execute_notebook_list, execute_notebook_list_finalize_ut
class TestCacheU... | true | true |
1c19d25fb5a4c996d935f8b3287a0e0a6b8c05f3 | 11,980 | py | Python | paddleseg/models/backbones/mobilenetv3.py | JamesLim-sy/PaddleSeg | f8cfb80f543a52599d1588026e71f069b702b781 | [
"Apache-2.0"
] | 4,708 | 2019-08-26T13:54:39.000Z | 2022-03-31T16:01:53.000Z | paddleseg/models/backbones/mobilenetv3.py | JamesLim-sy/PaddleSeg | f8cfb80f543a52599d1588026e71f069b702b781 | [
"Apache-2.0"
] | 1,083 | 2019-09-12T02:57:24.000Z | 2022-03-31T13:30:30.000Z | paddleseg/models/backbones/mobilenetv3.py | JamesLim-sy/PaddleSeg | f8cfb80f543a52599d1588026e71f069b702b781 | [
"Apache-2.0"
] | 1,046 | 2019-08-26T22:05:01.000Z | 2022-03-30T14:09:28.000Z | # 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.821918 | 155 | 0.536728 |
import paddle
import paddle.nn as nn
import paddle.nn.functional as F
from paddleseg.cvlibs import manager
from paddleseg.utils import utils
from paddleseg.models import layers
__all__ = [
"MobileNetV3_small_x0_35", "MobileNetV3_small_x0_5",
"MobileNetV3_small_x0_75", "MobileNetV3_small_x1_0",
... | true | true |
1c19d27d1e2c38610b7fff456c29ac0daf5a1660 | 1,240 | py | Python | miniTidyPy/my_dropna.py | UBC-MDS/mini_tidy_python | 055b3d508dbfe740ab46f681fadb1b4714ee3778 | [
"MIT"
] | null | null | null | miniTidyPy/my_dropna.py | UBC-MDS/mini_tidy_python | 055b3d508dbfe740ab46f681fadb1b4714ee3778 | [
"MIT"
] | 9 | 2019-02-06T19:41:13.000Z | 2019-03-06T00:54:13.000Z | miniTidyPy/my_dropna.py | UBC-MDS/mini_tidy_python | 055b3d508dbfe740ab46f681fadb1b4714ee3778 | [
"MIT"
] | 1 | 2019-02-06T00:06:37.000Z | 2019-02-06T00:06:37.000Z | # February 2019
# This script defines the function my_dropna.py
# The function creates a new dataframe by removing the rows with "NaN" values in the original dataframe
#------------------------------------
# Required packages
import pandas as pd
#------------------------------------
# Define function
def my_dropna(X: p... | 29.52381 | 108 | 0.575806 |
import pandas as pd
def my_dropna(X: pd.core.frame.DataFrame) -> pd.core.frame.DataFrame:
if not isinstance(X, pd.DataFrame):
raise TypeError("Expect input to be a dataframe")
def isNaN(num):
return num != num
rows = X.shape[0]
columns = X.shape[1]
Y=X
for i in ran... | true | true |
1c19d2ac79f5e5f380658e5cfddf210eb5873124 | 1,487 | py | Python | swan/io/ioutil.py | CodeAlkemist/IOExtensionsPy | bdf2347115a9de4b84ade6d4cea6eeec2c47f5de | [
"BSD-3-Clause"
] | null | null | null | swan/io/ioutil.py | CodeAlkemist/IOExtensionsPy | bdf2347115a9de4b84ade6d4cea6eeec2c47f5de | [
"BSD-3-Clause"
] | null | null | null | swan/io/ioutil.py | CodeAlkemist/IOExtensionsPy | bdf2347115a9de4b84ade6d4cea6eeec2c47f5de | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2018 Computer Raven, All rights reserved
# IO utilities library core components
import ntpath
import os
import platform
import subprocess
import psutil
import swan.util
import io
def use_chunks(size):
mem = psutil.virtual_memory()
return True if mem.total//4 >= size else False
def hide_file... | 25.20339 | 114 | 0.69267 |
import ntpath
import os
import platform
import subprocess
import psutil
import swan.util
import io
def use_chunks(size):
mem = psutil.virtual_memory()
return True if mem.total//4 >= size else False
def hide_file(path):
if platform.system() == 'Windows':
subprocess.check_call(["attrib", "+H",... | true | true |
1c19d32606310e7330d303a0bbf4a5b904bcd2bd | 300 | py | Python | oonib/deck/api.py | irl/ooni-backend | 805e25c04e512d807e09656147822ebf6e579ca8 | [
"BSD-2-Clause-FreeBSD"
] | 20 | 2020-02-17T09:49:14.000Z | 2022-02-12T06:32:34.000Z | oonib/deck/api.py | irl/ooni-backend | 805e25c04e512d807e09656147822ebf6e579ca8 | [
"BSD-2-Clause-FreeBSD"
] | 455 | 2020-01-13T15:15:36.000Z | 2022-03-29T11:13:03.000Z | oonib/deck/api.py | irl/ooni-backend | 805e25c04e512d807e09656147822ebf6e579ca8 | [
"BSD-2-Clause-FreeBSD"
] | 9 | 2015-07-16T18:59:09.000Z | 2017-08-19T14:13:28.000Z | from cyclone import web
from oonib.deck import handlers
from oonib.config import config
deckAPI = [
(r"/deck", handlers.DeckListHandler),
(r"/deck/([a-z0-9]{64})$", handlers.DeckDescHandler),
(r"/deck/([a-z0-9]{64})/file$", web.StaticFileHandler,
{"path": config.main.deck_dir}),
]
| 27.272727 | 58 | 0.666667 | from cyclone import web
from oonib.deck import handlers
from oonib.config import config
deckAPI = [
(r"/deck", handlers.DeckListHandler),
(r"/deck/([a-z0-9]{64})$", handlers.DeckDescHandler),
(r"/deck/([a-z0-9]{64})/file$", web.StaticFileHandler,
{"path": config.main.deck_dir}),
]
| true | true |
1c19d34cd88ece466bafc3ab8777f9c3d6337b22 | 14,838 | py | Python | argo/workflows/client/models/__init__.py | fvdnabee/argo-client-python | 0caa743442d37f2f2e3b30867398ed2708c1bf4d | [
"Apache-2.0"
] | 35 | 2019-10-25T09:19:36.000Z | 2022-03-04T11:22:27.000Z | argo/workflows/client/models/__init__.py | fvdnabee/argo-client-python | 0caa743442d37f2f2e3b30867398ed2708c1bf4d | [
"Apache-2.0"
] | 17 | 2019-10-30T03:49:20.000Z | 2020-07-02T15:54:50.000Z | argo/workflows/client/models/__init__.py | fvdnabee/argo-client-python | 0caa743442d37f2f2e3b30867398ed2708c1bf4d | [
"Apache-2.0"
] | 9 | 2019-11-06T13:30:08.000Z | 2021-06-12T03:00:05.000Z | # coding: utf-8
# flake8: noqa
"""
Argo
Python client for Argo Workflows # noqa: E501
OpenAPI spec version: master
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
# import models into model package
from argo.workflows.client.models.... | 78.925532 | 120 | 0.90248 |
from __future__ import absolute_import
from argo.workflows.client.models.google_protobuf_any import GoogleProtobufAny
from argo.workflows.client.models.grpc_gateway_runtime_stream_error import GrpcGatewayRuntimeStreamError
from argo.workflows.client.models.v1_aws_elastic_block_store_volume_source import V1AWSEla... | true | true |
1c19d3c320031bff7eb80c8c026ea1f1c1f03cee | 3,054 | py | Python | jax_verify/src/mip_solver/solve_relaxation.py | lberrada/jax_verify | 259250b0f36453450177cfc9c80e25fec41e6d6b | [
"Apache-2.0"
] | 109 | 2020-10-22T15:35:07.000Z | 2022-03-23T03:53:58.000Z | jax_verify/src/mip_solver/solve_relaxation.py | lberrada/jax_verify | 259250b0f36453450177cfc9c80e25fec41e6d6b | [
"Apache-2.0"
] | 2 | 2021-07-20T09:21:08.000Z | 2022-01-06T17:18:54.000Z | jax_verify/src/mip_solver/solve_relaxation.py | lberrada/jax_verify | 259250b0f36453450177cfc9c80e25fec41e6d6b | [
"Apache-2.0"
] | 16 | 2020-10-22T16:30:32.000Z | 2022-03-23T03:54:01.000Z | # coding=utf-8
# Copyright 2021 The jax_verify 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 la... | 45.58209 | 80 | 0.778978 |
from jax_verify.src import bound_propagation
from jax_verify.src.mip_solver import cvxpy_relaxation_solver
from jax_verify.src.mip_solver import relaxation
def solve_planet_relaxation(
logits_fn, initial_bounds, boundprop_transform,
objective, objective_bias, index,
solver=cvxpy_relaxation... | true | true |
1c19d3cfe3ecb64bae25b0c4065d897cfdaa4893 | 2,987 | py | Python | fastML.py | SergioSV96/fastML | 260b90c85d8a366504001a9b5b3a30cc193a36c6 | [
"MIT"
] | 1 | 2020-07-05T12:49:25.000Z | 2020-07-05T12:49:25.000Z | fastML.py | Fuadeiza/fastML | e9311f3e51cfd06a898d254b0456b2b31e191746 | [
"MIT"
] | null | null | null | fastML.py | Fuadeiza/fastML | e9311f3e51cfd06a898d254b0456b2b31e191746 | [
"MIT"
] | null | null | null |
def fastML(X, Y, size):
from sklearn.metrics import accuracy_score, confusion_matrix, classification_report
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestClassifier
from sklearn.tree import DecisionTreeClassifier
from sklearn.neighbors import KN... | 46.671875 | 137 | 0.688651 |
def fastML(X, Y, size):
from sklearn.metrics import accuracy_score, confusion_matrix, classification_report
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestClassifier
from sklearn.tree import DecisionTreeClassifier
from sklearn.neighbors import KN... | true | true |
1c19d41a9f92b2d0d41036330f4228e0887a8225 | 14,564 | py | Python | s1_scripts_for_processing_rawdata/s2_genRoi_mod.py | puapinyoying/isoseq_manuscript_resources | dc115fcbc9218b9a2a3092a6963bfc61f32bfd4c | [
"MIT"
] | 3 | 2020-06-22T09:24:03.000Z | 2021-02-27T13:40:45.000Z | s1_scripts_for_processing_rawdata/s2_genRoi_mod.py | puapinyoying/isoseq_manuscript_resources | dc115fcbc9218b9a2a3092a6963bfc61f32bfd4c | [
"MIT"
] | null | null | null | s1_scripts_for_processing_rawdata/s2_genRoi_mod.py | puapinyoying/isoseq_manuscript_resources | dc115fcbc9218b9a2a3092a6963bfc61f32bfd4c | [
"MIT"
] | 2 | 2021-02-27T13:40:45.000Z | 2022-01-14T13:51:38.000Z | # %load test_roi.py
import os
import sys
import glob
import errno
import argparse
# This script is to merge several ccs data cells into analysis groups I'll call
# reads of insert files. Since this script contains information on which cells
# are being combined, I also generate file of filenames for the ccs.h5 and
#... | 45.798742 | 96 | 0.697061 |
import os
import sys
import glob
import errno
import argparse
# reads of insert files. Since this script contains information on which cells
# are being combined, I also generate file of filenames for the ccs.h5 and
# bax.h5 files that are needed for step 4: clustering.
###############################
### CUSTOM F... | false | true |
1c19d4cf8863754aaa089175a81ddcaf5fc0f835 | 4,008 | py | Python | eye_tracking/eye_track_cnn.py | jinPrelude/eye_tracking | 2d9e14df274e4de5d26de4589e47756522662506 | [
"MIT"
] | 1 | 2019-08-19T05:46:39.000Z | 2019-08-19T05:46:39.000Z | eye_tracking/eye_track_cnn.py | jinPrelude/eye_tracking | 2d9e14df274e4de5d26de4589e47756522662506 | [
"MIT"
] | null | null | null | eye_tracking/eye_track_cnn.py | jinPrelude/eye_tracking | 2d9e14df274e4de5d26de4589e47756522662506 | [
"MIT"
] | null | null | null | import tensorflow as tf
import numpy as np
import cv2
import os
img_width = 640
img_height = 480
os.chdir('/home/leejin/git/image_processing/eye-tracking')
def next_batch(i, batch_size):
os.chdir('/home/leejin/git/image_processing/eye-tracking')
list = np.loadtxt('dataset/3/eyesPos.csv', dtype='int', delim... | 30.830769 | 110 | 0.664421 | import tensorflow as tf
import numpy as np
import cv2
import os
img_width = 640
img_height = 480
os.chdir('/home/leejin/git/image_processing/eye-tracking')
def next_batch(i, batch_size):
os.chdir('/home/leejin/git/image_processing/eye-tracking')
list = np.loadtxt('dataset/3/eyesPos.csv', dtype='int', delim... | true | true |
1c19d5b1605362b2c84436570b0531a00514d0ec | 508 | py | Python | users/migrations/0019_auto_20201117_1057.py | ominicomdevgt/LaChalupa | 3e7ea16fa97aa311bd3513dc463c30c37dfb5761 | [
"MIT"
] | null | null | null | users/migrations/0019_auto_20201117_1057.py | ominicomdevgt/LaChalupa | 3e7ea16fa97aa311bd3513dc463c30c37dfb5761 | [
"MIT"
] | null | null | null | users/migrations/0019_auto_20201117_1057.py | ominicomdevgt/LaChalupa | 3e7ea16fa97aa311bd3513dc463c30c37dfb5761 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.2 on 2020-11-17 16:57
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0018_auto_20201116_1943'),
]
operations = [
migrations.AlterField(
model_name='profile',
name='comment',
... | 26.736842 | 172 | 0.643701 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0018_auto_20201116_1943'),
]
operations = [
migrations.AlterField(
model_name='profile',
name='comment',
field=models.CharField(blank=True, de... | true | true |
1c19d6fc51ebc9fc54f5870af903a3a67e61817e | 1,730 | py | Python | v1.0/musicGenerator.py | mart-84/music-generator | 6403e878157dec873c2135ad8ce65c1c7b92393e | [
"MIT"
] | 1 | 2021-12-09T07:03:48.000Z | 2021-12-09T07:03:48.000Z | v1.0/musicGenerator.py | mart-84/music-generator | 6403e878157dec873c2135ad8ce65c1c7b92393e | [
"MIT"
] | null | null | null | v1.0/musicGenerator.py | mart-84/music-generator | 6403e878157dec873c2135ad8ce65c1c7b92393e | [
"MIT"
] | null | null | null | import datetime
import json
from LoadingRotationBar import LoadingRotationBar
import random
def generate_music(longueur: int):
print("Démarrage de la génération d'une musique")
animation = LoadingRotationBar()
start = datetime.datetime.now()
# constantes
data_file = "frequences_notes.json"
# n... | 32.037037 | 107 | 0.678613 | import datetime
import json
from LoadingRotationBar import LoadingRotationBar
import random
def generate_music(longueur: int):
print("Démarrage de la génération d'une musique")
animation = LoadingRotationBar()
start = datetime.datetime.now()
# constantes
data_file = "frequences_notes.json"
# n... | true | true |
1c19d726932cd259718525df5020978966056c7b | 510 | py | Python | demo.py | cmur2/python-veml6070 | 9aaaef89814e057c29864c4ac40baaef7569747a | [
"MIT"
] | 10 | 2017-01-20T10:42:14.000Z | 2021-04-04T13:00:33.000Z | demo.py | cmur2/python-veml6070 | 9aaaef89814e057c29864c4ac40baaef7569747a | [
"MIT"
] | 8 | 2018-05-14T15:14:19.000Z | 2019-04-01T15:32:09.000Z | demo.py | cmur2/python-veml6070 | 9aaaef89814e057c29864c4ac40baaef7569747a | [
"MIT"
] | 4 | 2017-01-20T11:09:10.000Z | 2020-12-06T15:22:23.000Z | #!/usr/bin/env python
import veml6070
ALL_INTEGRATION_TIMES = [
veml6070.INTEGRATIONTIME_1_2T, veml6070.INTEGRATIONTIME_1T, veml6070.INTEGRATIONTIME_2T, veml6070.INTEGRATIONTIME_4T
]
if __name__ == '__main__':
veml = veml6070.Veml6070()
for i in ALL_INTEGRATION_TIMES:
veml.set_integration_time(i)... | 31.875 | 120 | 0.717647 |
import veml6070
ALL_INTEGRATION_TIMES = [
veml6070.INTEGRATIONTIME_1_2T, veml6070.INTEGRATIONTIME_1T, veml6070.INTEGRATIONTIME_2T, veml6070.INTEGRATIONTIME_4T
]
if __name__ == '__main__':
veml = veml6070.Veml6070()
for i in ALL_INTEGRATION_TIMES:
veml.set_integration_time(i)
uv_raw = vem... | true | true |
1c19d78b10f0e48ea3069e15a75fd930d71fa4f0 | 23 | py | Python | pylsl/version.py | novikov-p-a/liblsl-Python | 88a4d35a0d7b34c9ac4bffc6db9033555152b412 | [
"MIT"
] | 433 | 2015-01-09T23:49:01.000Z | 2022-03-09T11:31:40.000Z | pylsl/version.py | novikov-p-a/liblsl-Python | 88a4d35a0d7b34c9ac4bffc6db9033555152b412 | [
"MIT"
] | 100 | 2015-01-13T05:02:21.000Z | 2020-10-16T14:22:06.000Z | pylsl/version.py | novikov-p-a/liblsl-Python | 88a4d35a0d7b34c9ac4bffc6db9033555152b412 | [
"MIT"
] | 170 | 2015-01-13T19:06:48.000Z | 2022-03-31T09:02:06.000Z | __version__ = '1.15.0'
| 11.5 | 22 | 0.652174 | __version__ = '1.15.0'
| true | true |
1c19d8bf2d15350cc3a0d178069a05b3188562a6 | 25,514 | py | Python | site-packages/glanceclient/tests/unit/v2/test_metadefs_namespaces.py | hariza17/freezer_libraries | e0bd890eba5e7438976fb3b4d66c41c128bab790 | [
"PSF-2.0"
] | null | null | null | site-packages/glanceclient/tests/unit/v2/test_metadefs_namespaces.py | hariza17/freezer_libraries | e0bd890eba5e7438976fb3b4d66c41c128bab790 | [
"PSF-2.0"
] | null | null | null | site-packages/glanceclient/tests/unit/v2/test_metadefs_namespaces.py | hariza17/freezer_libraries | e0bd890eba5e7438976fb3b4d66c41c128bab790 | [
"PSF-2.0"
] | 1 | 2019-01-11T16:11:42.000Z | 2019-01-11T16:11:42.000Z | # Copyright 2012 OpenStack Foundation.
# 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 req... | 37.465492 | 78 | 0.388297 |
import testtools
from glanceclient.tests.unit.v2 import base
from glanceclient.tests import utils
from glanceclient.v2 import metadefs
NAMESPACE1 = 'Namespace1'
NAMESPACE2 = 'Namespace2'
NAMESPACE3 = 'Namespace3'
NAMESPACE4 = 'Namespace4'
NAMESPACE5 = 'Namespace5'
NAMESPACE6 = 'Namespace6'
NAMESPACE7 =... | true | true |
1c19d926337312df1d0e067b3f6b18453a847d0f | 6,504 | py | Python | maggy/core/executors/trial_executor.py | ssheikholeslami/maggy | 0d9a4cbbf6120d7453b75515b082feae3c3530c2 | [
"Apache-2.0"
] | 2 | 2019-06-15T10:54:00.000Z | 2020-11-29T23:32:32.000Z | maggy/core/executors/trial_executor.py | ssheikholeslami/maggy | 0d9a4cbbf6120d7453b75515b082feae3c3530c2 | [
"Apache-2.0"
] | null | null | null | maggy/core/executors/trial_executor.py | ssheikholeslami/maggy | 0d9a4cbbf6120d7453b75515b082feae3c3530c2 | [
"Apache-2.0"
] | 1 | 2019-03-16T19:45:01.000Z | 2019-03-16T19:45:01.000Z | #
# Copyright 2021 Logical Clocks AB
#
# 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 ag... | 34.780749 | 91 | 0.589022 |
import builtins as __builtin__
import inspect
import json
import traceback
from typing import Callable, Any
from maggy import util, tensorboard
from maggy.core import rpc, exceptions
from maggy.core.reporter import Reporter
from maggy.core.environment.singleton import EnvSing
def trial_executor_fn(
... | true | true |
1c19d9eed13b4072de066c46897139a33dc493ac | 3,512 | py | Python | registration_eval/unused/register_ia.py | mirestrepo/voxels-at-lems | df47d031653d2ad877a97b3c1ea574b924b7d4c2 | [
"BSD-2-Clause"
] | 2 | 2015-09-18T00:17:16.000Z | 2019-02-06T04:41:29.000Z | registration_eval/unused/register_ia.py | mirestrepo/voxels-at-lems | df47d031653d2ad877a97b3c1ea574b924b7d4c2 | [
"BSD-2-Clause"
] | null | null | null | registration_eval/unused/register_ia.py | mirestrepo/voxels-at-lems | df47d031653d2ad877a97b3c1ea574b924b7d4c2 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
"""
Author: Isabel Restrepo
August 15, 2012
Compute rigid transformation between two point clounds using feature correspondances
"""
import os, sys, subprocess
import glob
import time
import argparse
from xml.etree.ElementTree import ElementTree
from vpcl_adaptor import *
from b... | 41.809524 | 169 | 0.675399 |
"""
Author: Isabel Restrepo
August 15, 2012
Compute rigid transformation between two point clounds using feature correspondances
"""
import os, sys, subprocess
import glob
import time
import argparse
from xml.etree.ElementTree import ElementTree
from vpcl_adaptor import *
from boxm2_utils import *
def main():
par... | false | true |
1c19da60464b7dc939085b4a0666c94abda9bc04 | 6,500 | py | Python | api/api_methods.py | NischalChenna/SamlTestOkta | 0884d88ff205759e26f8b255283bd2e5b2eaeafa | [
"MIT"
] | null | null | null | api/api_methods.py | NischalChenna/SamlTestOkta | 0884d88ff205759e26f8b255283bd2e5b2eaeafa | [
"MIT"
] | null | null | null | api/api_methods.py | NischalChenna/SamlTestOkta | 0884d88ff205759e26f8b255283bd2e5b2eaeafa | [
"MIT"
] | null | null | null | from logging import error
from database import database
from parse_xml import parse_xml
from flask import request
class saml:
def extract_xml_attributes():
if request.method == 'POST':
request_body = request.get_data()
request_body_in_string = parse_xml.decode_request_body_to_string... | 46.428571 | 256 | 0.573077 | from logging import error
from database import database
from parse_xml import parse_xml
from flask import request
class saml:
def extract_xml_attributes():
if request.method == 'POST':
request_body = request.get_data()
request_body_in_string = parse_xml.decode_request_body_to_string... | true | true |
1c19db2e901feef18d2c93d300cc7b795ece465d | 1,026 | py | Python | app/migrations/0083_auto_20201204_0014.py | InovTe4/DjangoWebProject2 | a028633b467dd2e384487a3e1495da5938a489ff | [
"Apache-2.0"
] | null | null | null | app/migrations/0083_auto_20201204_0014.py | InovTe4/DjangoWebProject2 | a028633b467dd2e384487a3e1495da5938a489ff | [
"Apache-2.0"
] | null | null | null | app/migrations/0083_auto_20201204_0014.py | InovTe4/DjangoWebProject2 | a028633b467dd2e384487a3e1495da5938a489ff | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2020-12-03 21:14
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0082_auto_20201204_0013'),
]
operations = [
migrati... | 32.0625 | 142 | 0.615984 |
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0082_auto_20201204_0013'),
]
operations = [
migrations.AlterField(
model_name='blog',
name='posted'... | true | true |
1c19db81897a53f2385aa604f45c04a2d3bd5972 | 2,548 | py | Python | ApolloConfig.py | ztj1993/py-apollo-config | a411830cf0f219cd8a91c02cc955dd90ec7373ee | [
"MIT"
] | null | null | null | ApolloConfig.py | ztj1993/py-apollo-config | a411830cf0f219cd8a91c02cc955dd90ec7373ee | [
"MIT"
] | null | null | null | ApolloConfig.py | ztj1993/py-apollo-config | a411830cf0f219cd8a91c02cc955dd90ec7373ee | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Author: Ztj
# Email: ztj1993@gmail.com
import os
from ApolloClient import ApolloClient
from ConfigRegistry import ConfigRegistry
class ApolloConfig(object):
def __init__(self, prefix):
self._apollo = None
self._registry = None
self.prefix = (prefix if prefix.end... | 30.698795 | 80 | 0.58281 |
import os
from ApolloClient import ApolloClient
from ConfigRegistry import ConfigRegistry
class ApolloConfig(object):
def __init__(self, prefix):
self._apollo = None
self._registry = None
self.prefix = (prefix if prefix.endswith('_') else prefix + '_').upper()
@property
def r... | true | true |
1c19dc0b827e85bd87798944205de9b331c21917 | 351 | py | Python | examples/PassListArgument.py | Ellis0817/Introduction-to-Programming-Using-Python | 1882a2a846162d5ff56d4d56c3940b638ef408bd | [
"MIT"
] | null | null | null | examples/PassListArgument.py | Ellis0817/Introduction-to-Programming-Using-Python | 1882a2a846162d5ff56d4d56c3940b638ef408bd | [
"MIT"
] | 4 | 2019-11-07T12:32:19.000Z | 2020-07-19T14:04:44.000Z | examples/PassListArgument.py | Ellis0817/Introduction-to-Programming-Using-Python | 1882a2a846162d5ff56d4d56c3940b638ef408bd | [
"MIT"
] | 5 | 2019-12-04T15:56:55.000Z | 2022-01-14T06:19:18.000Z | def main():
x = 1 # x represents an int value
y = [1, 2, 3] # y represents a list
m(x, y) # Invoke f with arguments x and y
print("x is", x)
print("y[0] is", y[0])
def m(number, numbers):
number = 1001 # Assign a new value to number
numbers[0] = 5555 # Assign a new value to numbers[0]
m... | 23.4 | 56 | 0.592593 | def main():
x = 1
y = [1, 2, 3]
m(x, y)
print("x is", x)
print("y[0] is", y[0])
def m(number, numbers):
number = 1001
numbers[0] = 5555
main()
| true | true |
1c19dc73ad1c15e20c8f55d7f161592cb6a30241 | 3,542 | py | Python | tests/api/v1/test_list_projects_scenarios.py | citrix-openstack-build/ceilometer | 29f2ffc7e511a152d6e8742cd233c3dc399b8fff | [
"Apache-2.0"
] | null | null | null | tests/api/v1/test_list_projects_scenarios.py | citrix-openstack-build/ceilometer | 29f2ffc7e511a152d6e8742cd233c3dc399b8fff | [
"Apache-2.0"
] | null | null | null | tests/api/v1/test_list_projects_scenarios.py | citrix-openstack-build/ceilometer | 29f2ffc7e511a152d6e8742cd233c3dc399b8fff | [
"Apache-2.0"
] | null | null | null | # -*- encoding: utf-8 -*-
#
# Copyright © 2012 New Dream Network, LLC (DreamHost)
#
# Author: Doug Hellmann <doug.hellmann@dreamhost.com>
# Julien Danjou <julien@danjou.info>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. Yo... | 32.495413 | 75 | 0.603896 |
import datetime
import logging
import testscenarios
from oslo.config import cfg
from ceilometer.publisher import rpc
from ceilometer import sample
from ceilometer.tests import api as tests_api
from ceilometer.tests import db as tests_db
load_tests = testscenarios.load_tests_apply_scenarios
LOG =... | true | true |
1c19dd273f641cbc7b96876332a53e0e679139b7 | 5,483 | py | Python | randum/sphinx/documentor.py | tactlabs/randum | 11274a52d206f9fcc2ec1a8935257d93fd83fe66 | [
"MIT"
] | null | null | null | randum/sphinx/documentor.py | tactlabs/randum | 11274a52d206f9fcc2ec1a8935257d93fd83fe66 | [
"MIT"
] | null | null | null | randum/sphinx/documentor.py | tactlabs/randum | 11274a52d206f9fcc2ec1a8935257d93fd83fe66 | [
"MIT"
] | null | null | null | # coding=utf-8
import importlib
import inspect
import os
from pathlib import Path
from randum.config import AVAILABLE_LOCALES
from randum.config import PROVIDERS as STANDARD_PROVIDER_NAMES
from randum.providers import BaseProvider
if os.environ.get("READTHEDOCS", False):
version = os.environ["READTHEDOCS_VERSION... | 34.26875 | 94 | 0.661317 |
import importlib
import inspect
import os
from pathlib import Path
from randum.config import AVAILABLE_LOCALES
from randum.config import PROVIDERS as STANDARD_PROVIDER_NAMES
from randum.providers import BaseProvider
if os.environ.get("READTHEDOCS", False):
version = os.environ["READTHEDOCS_VERSION"]
HOME = ... | true | true |
1c19df567c0d77fc131d0a61fd2774cd1477c7a2 | 1,520 | py | Python | workload-analyzer/ContextSwitches.py | jjkotni/faas-profiler | 3a7565981d7b6f7a03b1d7595e458ef1ff20e8b9 | [
"MIT"
] | null | null | null | workload-analyzer/ContextSwitches.py | jjkotni/faas-profiler | 3a7565981d7b6f7a03b1d7595e458ef1ff20e8b9 | [
"MIT"
] | null | null | null | workload-analyzer/ContextSwitches.py | jjkotni/faas-profiler | 3a7565981d7b6f7a03b1d7595e458ef1ff20e8b9 | [
"MIT"
] | 1 | 2019-11-21T12:23:41.000Z | 2019-11-21T12:23:41.000Z | import pdb
from PerfMonAnalyzer import ReadPerfMon
import matplotlib.pyplot as plt
import pandas as pd
import pdb
from WorkloadChecker import CheckWorkloadValidity
def main():
axes =[]
plt.figure()
# for i in [20, 45, 60, 120]: #gap between expts
# for j in [3,6, 9, 12, 15, 18, 21, 24, 27, 30, 40, 5... | 35.348837 | 98 | 0.555921 | import pdb
from PerfMonAnalyzer import ReadPerfMon
import matplotlib.pyplot as plt
import pandas as pd
import pdb
from WorkloadChecker import CheckWorkloadValidity
def main():
axes =[]
plt.figure()
, 60, 120]):
axes.append(None)
for j in [6, 9, 18, 30, 75, 125]:
df_all_runs = Non... | true | true |
1c19dfb33a6ebc155670f0c08eb58365c4b97604 | 19,252 | py | Python | homeassistant/components/template/light.py | marioedani/homeassistant-core | 2bc5db857ec6aa605ea7ff363654db2109f7cec4 | [
"Apache-2.0"
] | 1 | 2020-04-07T15:44:54.000Z | 2020-04-07T15:44:54.000Z | homeassistant/components/template/light.py | marioedani/homeassistant-core | 2bc5db857ec6aa605ea7ff363654db2109f7cec4 | [
"Apache-2.0"
] | 3 | 2021-09-08T03:31:36.000Z | 2022-03-12T01:00:03.000Z | homeassistant/components/template/light.py | marioedani/homeassistant-core | 2bc5db857ec6aa605ea7ff363654db2109f7cec4 | [
"Apache-2.0"
] | 1 | 2020-06-01T12:43:03.000Z | 2020-06-01T12:43:03.000Z | """Support for Template lights."""
import logging
import voluptuous as vol
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_COLOR_TEMP,
ATTR_HS_COLOR,
ATTR_WHITE_VALUE,
ENTITY_ID_FORMAT,
SUPPORT_BRIGHTNESS,
SUPPORT_COLOR,
SUPPORT_COLOR_TEMP,
SUPPORT_WHITE_VALUE,
... | 34.876812 | 105 | 0.59999 | import logging
import voluptuous as vol
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_COLOR_TEMP,
ATTR_HS_COLOR,
ATTR_WHITE_VALUE,
ENTITY_ID_FORMAT,
SUPPORT_BRIGHTNESS,
SUPPORT_COLOR,
SUPPORT_COLOR_TEMP,
SUPPORT_WHITE_VALUE,
Light,
)
from homeassistant.cons... | true | true |
1c19e0167dc370aadf319447ef31936347a06289 | 258 | py | Python | codeforces/math数学/900/318A先奇后偶.py | yofn/pyacm | e573f8fdeea77513711f00c42f128795cbba65a6 | [
"Apache-2.0"
] | null | null | null | codeforces/math数学/900/318A先奇后偶.py | yofn/pyacm | e573f8fdeea77513711f00c42f128795cbba65a6 | [
"Apache-2.0"
] | null | null | null | codeforces/math数学/900/318A先奇后偶.py | yofn/pyacm | e573f8fdeea77513711f00c42f128795cbba65a6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# https://codeforces.com/problemset/problem/318/A
def f(l):
n, k = l
odd = k <= (n+1)//2
off = ((k-1) % ((n+1)//2)) + 1
return (off<<1)-1 if odd else (off<<1)
l = list(map(int,input().split()))
print(f(l))
| 18.428571 | 49 | 0.507752 |
def f(l):
n, k = l
odd = k <= (n+1)//2
off = ((k-1) % ((n+1)//2)) + 1
return (off<<1)-1 if odd else (off<<1)
l = list(map(int,input().split()))
print(f(l))
| true | true |
1c19e0832b139ff656b51f4c4b00b311bee968d5 | 2,303 | py | Python | tests/random_expression.py | aitrek/quepy3 | 977452585bd04765a1e3d30d3d354b73d4a261cf | [
"BSD-3-Clause"
] | 1 | 2022-03-20T06:37:30.000Z | 2022-03-20T06:37:30.000Z | tests/random_expression.py | aitrek/quepy3 | 977452585bd04765a1e3d30d3d354b73d4a261cf | [
"BSD-3-Clause"
] | null | null | null | tests/random_expression.py | aitrek/quepy3 | 977452585bd04765a1e3d30d3d354b73d4a261cf | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import random
from quepy3.expression import Expression
def random_data(only_ascii=False):
data = []
first = True
while first or 1 / 20.0 < random.random():
first = False
if only_ascii:
c = unichr(random.randint(33, 126))
data.append(c)
... | 30.706667 | 76 | 0.549284 |
import random
from quepy3.expression import Expression
def random_data(only_ascii=False):
data = []
first = True
while first or 1 / 20.0 < random.random():
first = False
if only_ascii:
c = unichr(random.randint(33, 126))
data.append(c)
continue
... | true | true |
1c19e1a39dfa51133ddd9be0083f40fb08fd02cc | 1,020 | py | Python | tally/migrations/0001_initial.py | dcwatson/tally | 593d52e6a722370647a11ec700b2e25175d3767d | [
"BSD-3-Clause"
] | 4 | 2015-11-10T14:16:52.000Z | 2020-07-01T05:02:39.000Z | tally/migrations/0001_initial.py | dcwatson/tally | 593d52e6a722370647a11ec700b2e25175d3767d | [
"BSD-3-Clause"
] | 1 | 2015-03-09T16:36:58.000Z | 2015-03-10T13:58:10.000Z | tally/migrations/0001_initial.py | dcwatson/tally | 593d52e6a722370647a11ec700b2e25175d3767d | [
"BSD-3-Clause"
] | 5 | 2016-06-09T09:51:47.000Z | 2021-07-07T10:34:22.000Z | # encoding: utf8
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Archive',
fields=[
(u'id', models.AutoField(verbose_name=u'ID', serialize=False, auto_created=T... | 35.172414 | 116 | 0.551961 |
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Archive',
fields=[
(u'id', models.AutoField(verbose_name=u'ID', serialize=False, auto_created=True, primary_key... | true | true |
1c19e1b144d2961f14cb3542f3e46dd0560a7f82 | 16,033 | py | Python | Computer_science/B05_Python/01_Basics/S02_01_Composite_types.py | Polirecyliente/SGConocimiento | 560b08984236d7a10f50c6b5e6fb28844193d81b | [
"CC-BY-4.0"
] | null | null | null | Computer_science/B05_Python/01_Basics/S02_01_Composite_types.py | Polirecyliente/SGConocimiento | 560b08984236d7a10f50c6b5e6fb28844193d81b | [
"CC-BY-4.0"
] | null | null | null | Computer_science/B05_Python/01_Basics/S02_01_Composite_types.py | Polirecyliente/SGConocimiento | 560b08984236d7a10f50c6b5e6fb28844193d81b | [
"CC-BY-4.0"
] | null | null | null |
# Composite types
#T# Table of contents
#C# Composite types in general
#C# - Basic operators
#C# Strings
#C# - String formatting
#C# - U strings
#C# - R strings
#C# - B strings
#C# - F strings
#C# Lists
#C# Tuples
#C# Dictionaries
#C# Sets
#C# - Comparisons between sets
#C# Multidimensional composite types
#C# Com... | 36.52164 | 395 | 0.600948 |
nal composite type
# SYNTAX arr1[ini_elem1:final_elem1]
#T# this includes ini_elem1, up to before final_elem1 (excludes final_elem1) from arr1
str1 = "example string"
str2 = str1[2:5] # amp
# SYNTAX arr1[ini_elem1:final_elem1:step1]
#T# same as before, but form the slice stepping by step1 elements
list1 = [99, 9... | true | true |
1c19e27c47e23c760cb6ea641a775436015e360b | 261 | py | Python | aioaws/_types.py | tomhamiltonstubber/aioaws | 4ae59f2eba4ae2cfb0933599836a5eb4bd2d2ce1 | [
"MIT"
] | 85 | 2020-03-25T16:41:31.000Z | 2022-03-20T14:01:46.000Z | aioaws/_types.py | tomhamiltonstubber/aioaws | 4ae59f2eba4ae2cfb0933599836a5eb4bd2d2ce1 | [
"MIT"
] | 25 | 2020-10-05T15:06:39.000Z | 2022-03-16T16:00:53.000Z | aioaws/_types.py | tomhamiltonstubber/aioaws | 4ae59f2eba4ae2cfb0933599836a5eb4bd2d2ce1 | [
"MIT"
] | 6 | 2020-03-27T14:47:45.000Z | 2022-02-21T10:24:46.000Z | from typing import Protocol
class BaseConfigProtocol(Protocol):
aws_access_key: str
aws_secret_key: str
aws_region: str
class S3ConfigProtocol(Protocol):
aws_access_key: str
aws_secret_key: str
aws_region: str
aws_s3_bucket: str
| 17.4 | 35 | 0.743295 | from typing import Protocol
class BaseConfigProtocol(Protocol):
aws_access_key: str
aws_secret_key: str
aws_region: str
class S3ConfigProtocol(Protocol):
aws_access_key: str
aws_secret_key: str
aws_region: str
aws_s3_bucket: str
| true | true |
1c19e304599c59a94874f1a914cefccc5367e2d9 | 16,722 | py | Python | rasa_nlu/server.py | osmanbaskaya/rasa_nlu | 4f0b5d0fd0d058e437e7d74369cef212fd0a345b | [
"Apache-2.0"
] | null | null | null | rasa_nlu/server.py | osmanbaskaya/rasa_nlu | 4f0b5d0fd0d058e437e7d74369cef212fd0a345b | [
"Apache-2.0"
] | 6 | 2020-09-26T00:52:34.000Z | 2022-02-10T01:37:38.000Z | rasa_nlu/server.py | osmanbaskaya/rasa_nlu | 4f0b5d0fd0d058e437e7d74369cef212fd0a345b | [
"Apache-2.0"
] | 1 | 2018-10-11T21:04:31.000Z | 2018-10-11T21:04:31.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import logging
from builtins import str
from functools import wraps
import simplejson
import six
from klein import Klein
from twisted.internet import rea... | 36.510917 | 86 | 0.579596 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import logging
from builtins import str
from functools import wraps
import simplejson
import six
from klein import Klein
from twisted.internet import rea... | true | true |
1c19e3e73035a8b40953436f4f28aec80d383d94 | 749 | py | Python | setup.py | yobome/jupyterhub-ssh | 9626275d0253c7918a887167ede3642765856eb1 | [
"BSD-3-Clause"
] | null | null | null | setup.py | yobome/jupyterhub-ssh | 9626275d0253c7918a887167ede3642765856eb1 | [
"BSD-3-Clause"
] | null | null | null | setup.py | yobome/jupyterhub-ssh | 9626275d0253c7918a887167ede3642765856eb1 | [
"BSD-3-Clause"
] | null | null | null | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="jupyterhub-ssh",
version="0.1",
author="Yuvi Panda",
author_email="yuvipanda@gmail.com",
description="SSH access to JupyterHubs",
long_description=long_description,
long_descriptio... | 24.966667 | 54 | 0.626168 | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="jupyterhub-ssh",
version="0.1",
author="Yuvi Panda",
author_email="yuvipanda@gmail.com",
description="SSH access to JupyterHubs",
long_description=long_description,
long_descriptio... | true | true |
1c19e54505a3abc0a0b9744275f10e828a915e98 | 6,524 | py | Python | td_svm_classifier/train.py | Digital-Signal-Processing-Lab1/simple-speech-recognizer | 884dd5a27d1a75640a6667f2eec47856b3bf8681 | [
"MIT"
] | null | null | null | td_svm_classifier/train.py | Digital-Signal-Processing-Lab1/simple-speech-recognizer | 884dd5a27d1a75640a6667f2eec47856b3bf8681 | [
"MIT"
] | null | null | null | td_svm_classifier/train.py | Digital-Signal-Processing-Lab1/simple-speech-recognizer | 884dd5a27d1a75640a6667f2eec47856b3bf8681 | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
import sys
# 注意在本机需要添加系统默认路径
sys.path.append(r"C:\Users\lenovo\simple-speech-recognizer")
from sklearn import svm
import sklearn.utils as su
from sklearn.model_selection import train_test_split
from sklearn.decomposition import PCA
import sklearn.metrics as sm
import scipy.signal as signal
impor... | 39.539394 | 118 | 0.685776 |
import sys
sys.path.append(r"C:\Users\lenovo\simple-speech-recognizer")
from sklearn import svm
import sklearn.utils as su
from sklearn.model_selection import train_test_split
from sklearn.decomposition import PCA
import sklearn.metrics as sm
import scipy.signal as signal
import os
import VAD
import utils
import num... | true | true |
1c19e5557b50a15d60aa28f6a2c1f703f3b3e880 | 5,411 | py | Python | locallibrary/catalog/views.py | toddbrentlinger/django-tutorial-mozilla | 427b384630f50d9f34ed92f58ce0f8c0ef2baeeb | [
"MIT"
] | null | null | null | locallibrary/catalog/views.py | toddbrentlinger/django-tutorial-mozilla | 427b384630f50d9f34ed92f58ce0f8c0ef2baeeb | [
"MIT"
] | null | null | null | locallibrary/catalog/views.py | toddbrentlinger/django-tutorial-mozilla | 427b384630f50d9f34ed92f58ce0f8c0ef2baeeb | [
"MIT"
] | null | null | null | import datetime
from django.shortcuts import render, get_object_or_404
from django.views import generic
from django.views.generic.edit import CreateView, UpdateView, DeleteView
from django.contrib.auth.decorators import login_required, permission_required
from django.contrib.auth.mixins import LoginRequiredMixin, Perm... | 37.317241 | 117 | 0.728146 | import datetime
from django.shortcuts import render, get_object_or_404
from django.views import generic
from django.views.generic.edit import CreateView, UpdateView, DeleteView
from django.contrib.auth.decorators import login_required, permission_required
from django.contrib.auth.mixins import LoginRequiredMixin, Perm... | true | true |
1c19e6aacb7085b3e1a8e5316028e4ca08b9de0f | 875 | py | Python | houdini_difflib/modules/node/sopnode.py | beesperester/houdini-diff | 7882a3273dcc04adba1640f6e270a3821668c31b | [
"MIT"
] | null | null | null | houdini_difflib/modules/node/sopnode.py | beesperester/houdini-diff | 7882a3273dcc04adba1640f6e270a3821668c31b | [
"MIT"
] | null | null | null | houdini_difflib/modules/node/sopnode.py | beesperester/houdini-diff | 7882a3273dcc04adba1640f6e270a3821668c31b | [
"MIT"
] | null | null | null | import hou
from typing import Dict, List, Any
from houdini_difflib.modules.node import node
def serialize_as_dict(sop_node_instance: hou.SopNode) -> Dict[str, Any]:
return {
**node.serialize_as_dict(sop_node_instance),
"isDisplayFlagSet": sop_node_instance.isDisplayFlagSet(),
"isRenderFl... | 31.25 | 72 | 0.742857 | import hou
from typing import Dict, List, Any
from houdini_difflib.modules.node import node
def serialize_as_dict(sop_node_instance: hou.SopNode) -> Dict[str, Any]:
return {
**node.serialize_as_dict(sop_node_instance),
"isDisplayFlagSet": sop_node_instance.isDisplayFlagSet(),
"isRenderFl... | true | true |
1c19e71650e6c35c74f46d1785ec57a48ac62d56 | 1,557 | py | Python | App/ressources/python27/Lib/site-packages/PyQt5/uic/widget-plugins/qaxcontainer.py | Wizard-collab/wizard | c2ec623fe011626716493c232b895fb0513f68ff | [
"MIT"
] | null | null | null | App/ressources/python27/Lib/site-packages/PyQt5/uic/widget-plugins/qaxcontainer.py | Wizard-collab/wizard | c2ec623fe011626716493c232b895fb0513f68ff | [
"MIT"
] | null | null | null | App/ressources/python27/Lib/site-packages/PyQt5/uic/widget-plugins/qaxcontainer.py | Wizard-collab/wizard | c2ec623fe011626716493c232b895fb0513f68ff | [
"MIT"
] | null | null | null | #############################################################################
##
## Copyright (c) 2014 Riverbank Computing Limited <info@riverbankcomputing.com>
##
## This file is part of PyQt5.
##
## This file may be used under the terms of the GNU General Public License
## version 3.0 as published by the Free Softw... | 45.794118 | 79 | 0.669236 | true | true | |
1c19e8f021fb8c8f27496fad3b3473796ee06c4b | 4,741 | py | Python | ckan/tests/functional/test_tag.py | Gnafu/ckan | d81f69b90291e50ef7e85821ccb83daa94eb3bb7 | [
"BSD-3-Clause"
] | 2 | 2021-02-19T20:06:52.000Z | 2021-04-15T20:42:11.000Z | ckan/tests/functional/test_tag.py | Gnafu/ckan | d81f69b90291e50ef7e85821ccb83daa94eb3bb7 | [
"BSD-3-Clause"
] | 1 | 2018-01-17T19:11:24.000Z | 2018-04-27T19:53:34.000Z | ckan/tests/functional/test_tag.py | Gnafu/ckan | d81f69b90291e50ef7e85821ccb83daa94eb3bb7 | [
"BSD-3-Clause"
] | 4 | 2016-12-17T22:26:06.000Z | 2017-01-20T21:51:24.000Z | import json
from ckan.tests import *
import ckan.model as model
HTTP_MOVED_PERMANENTLY = 301
class TestTagController(TestController):
@classmethod
def setup_class(self):
model.Session.remove()
CreateTestData.create()
@classmethod
def teardown_class(self):
model.repo.rebuild_... | 37.039063 | 96 | 0.612107 | import json
from ckan.tests import *
import ckan.model as model
HTTP_MOVED_PERMANENTLY = 301
class TestTagController(TestController):
@classmethod
def setup_class(self):
model.Session.remove()
CreateTestData.create()
@classmethod
def teardown_class(self):
model.repo.rebuild_... | true | true |
1c19e94ef5e2cdab2d563a2b8ad53b0c7781a434 | 29,229 | py | Python | oscar/lib/python2.7/site-packages/webtest/app.py | AMuratTuran/mkn | 557086426773ced10d82c969304bd349414a601e | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/webtest/app.py | AMuratTuran/mkn | 557086426773ced10d82c969304bd349414a601e | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/webtest/app.py | AMuratTuran/mkn | 557086426773ced10d82c969304bd349414a601e | [
"BSD-3-Clause"
] | null | null | null | # (c) 2005 Ian Bicking and contributors; written for Paste
# (http://pythonpaste.org)
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license.php
"""
Routines for testing WSGI applications.
Most interesting is TestApp
"""
from __future__ import unicode_literals
import os
import re
import js... | 36.998734 | 79 | 0.558281 |
from __future__ import unicode_literals
import os
import re
import json
import random
import fnmatch
import mimetypes
from base64 import b64encode
from six import StringIO
from six import BytesIO
from six import string_types
from six import binary_type
from six import text_type
from six.moves import http_cookiej... | true | true |
1c19eb1aa0a3bfd4b0ee0aea45bf310fff7c9b01 | 5,192 | py | Python | src/realsense-ransac/Python_scripts/point_cloud_848-480_resolution.py | Lucas-SEB/Sewer-Pipes-Measurement | b449a8b5110cedcd93b9e7f3a63d044bd299ba9f | [
"Apache-2.0"
] | 2 | 2022-02-01T12:47:25.000Z | 2022-03-09T13:47:36.000Z | src/realsense-ransac/Python_scripts/point_cloud_848-480_resolution.py | Lucas-SEB/Sewer-Pipes-Measurement | b449a8b5110cedcd93b9e7f3a63d044bd299ba9f | [
"Apache-2.0"
] | null | null | null | src/realsense-ransac/Python_scripts/point_cloud_848-480_resolution.py | Lucas-SEB/Sewer-Pipes-Measurement | b449a8b5110cedcd93b9e7f3a63d044bd299ba9f | [
"Apache-2.0"
] | 1 | 2021-12-16T22:27:50.000Z | 2021-12-16T22:27:50.000Z | import numpy as np # Fundamental package for scientific computing
import matplotlib.pyplot as plt # 2D plotting library producing publication quality figures
import pyrealsense2.pyrealsense2 as rs # Intel RealSense cross-platform open-source API
import open3d as o3d
import imageio
im... | 35.806897 | 109 | 0.769068 | import numpy as np
import matplotlib.pyplot as plt
import pyrealsense2.pyrealsense2 as rs
import open3d as o3d
import imageio
import cv2
import pyransac3d as pyrsc
from datetime import datetime as date
pipe = rs.pipeline()
cfg = rs.config()
cfg.enable_stre... | true | true |
1c19eb2d5dab63f49074182f1a303b9e56ee61b7 | 1,123 | py | Python | app/models.py | DimaWittmann/Registation | 86c324d5c094568c2efb2ddd3b8e2c312773a051 | [
"MIT"
] | null | null | null | app/models.py | DimaWittmann/Registation | 86c324d5c094568c2efb2ddd3b8e2c312773a051 | [
"MIT"
] | null | null | null | app/models.py | DimaWittmann/Registation | 86c324d5c094568c2efb2ddd3b8e2c312773a051 | [
"MIT"
] | null | null | null | import datetime
from werkzeug.security import generate_password_hash, check_password_hash
from app import db
class User(db.Model):
__tablename__ = 'user'
id = db.Column(db.Integer, primary_key=True, autoincrement=True)
email = db.Column(db.String(254), unique=True, nullable=False)
_password_hash = d... | 25.522727 | 73 | 0.66073 | import datetime
from werkzeug.security import generate_password_hash, check_password_hash
from app import db
class User(db.Model):
__tablename__ = 'user'
id = db.Column(db.Integer, primary_key=True, autoincrement=True)
email = db.Column(db.String(254), unique=True, nullable=False)
_password_hash = d... | true | true |
1c19eb596f3866ca9982ed21fe24b99ee7322851 | 6,968 | py | Python | elichika/elichika/parser/functions.py | kuenishi/chainer-compiler | 942c3b09759d0857ddc7c6bb93b81117d011ff50 | [
"MIT"
] | null | null | null | elichika/elichika/parser/functions.py | kuenishi/chainer-compiler | 942c3b09759d0857ddc7c6bb93b81117d011ff50 | [
"MIT"
] | null | null | null | elichika/elichika/parser/functions.py | kuenishi/chainer-compiler | 942c3b09759d0857ddc7c6bb93b81117d011ff50 | [
"MIT"
] | null | null | null |
import chainer
import chainer.functions as F
import chainer.links as L
import inspect
import ast, gast
import weakref
import numpy as np
from elichika.parser import vevaluator
from elichika.parser import nodes
from elichika.parser import values
from elichika.parser import functions
from elichika.parser import utils
... | 29.400844 | 115 | 0.624856 |
import chainer
import chainer.functions as F
import chainer.links as L
import inspect
import ast, gast
import weakref
import numpy as np
from elichika.parser import vevaluator
from elichika.parser import nodes
from elichika.parser import values
from elichika.parser import functions
from elichika.parser import utils
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.