hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | 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 247 | max_issues_repo_name stringlengths 4 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 247 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | 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 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0f4fe85ee8719ab88c1e26588ecd8b620a1a13ff | 817 | py | Python | mla_game/apps/transcript/migrations/0015_auto_20171027_1252.py | amazingwebdev/django-FixIt | 698aa7e4c45f07d86fbf209d1caca017ed136675 | [
"MIT"
] | null | null | null | mla_game/apps/transcript/migrations/0015_auto_20171027_1252.py | amazingwebdev/django-FixIt | 698aa7e4c45f07d86fbf209d1caca017ed136675 | [
"MIT"
] | null | null | null | mla_game/apps/transcript/migrations/0015_auto_20171027_1252.py | amazingwebdev/django-FixIt | 698aa7e4c45f07d86fbf209d1caca017ed136675 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-10-27 12:52
from __future__ import unicode_literals
| 24.757576 | 59 | 0.665851 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-10-27 12:52
from __future__ import unicode_literals
from django.db import migrations
def create_votes(apps, schema_editor):
TranscriptPhraseDownvote = apps.get_model(
'transcript', 'TranscriptPhraseDownvote'
)
TranscriptPhraseVote = app... | 0 | 0 | 0 | 167 | 0 | 455 | 0 | 11 | 69 |
55f86bf32670e94353a9369e3b19d5f9426c13c6 | 585 | py | Python | offer/16-shu-zhi-de-zheng-shu-ci-fang-lcof.py | wanglongjiang/leetcode | c61d2e719e81575cfb5bde9d64e15cee7cf01ef3 | [
"MIT"
] | 2 | 2021-03-14T11:38:26.000Z | 2021-03-14T11:38:30.000Z | offer/16-shu-zhi-de-zheng-shu-ci-fang-lcof.py | wanglongjiang/leetcode | c61d2e719e81575cfb5bde9d64e15cee7cf01ef3 | [
"MIT"
] | null | null | null | offer/16-shu-zhi-de-zheng-shu-ci-fang-lcof.py | wanglongjiang/leetcode | c61d2e719e81575cfb5bde9d64e15cee7cf01ef3 | [
"MIT"
] | 1 | 2022-01-17T19:33:23.000Z | 2022-01-17T19:33:23.000Z | '''
Offer 16.
pow(x, n) x n xn
'''
s = Solution()
print(s.myPow(2.0, 10) == 1024.0)
print(s.myPow(2.1, 3) == 9.261)
print(s.myPow(2.0, -2) == 0.25)
| 20.892857 | 55 | 0.473504 | '''
剑指 Offer 16. 数值的整数次方
实现 pow(x, n) ,即计算 x 的 n 次幂函数(即,xn)。不得使用库函数,同时不需要考虑大数问题。
'''
class Solution:
def myPow(self, x: float, n: int) -> float:
neg = n >= 0
n = abs(n)
product = 1
product2n = x
while n > 0:
if n & 1 == 1:
product = product * pro... | 135 | 0 | 0 | 361 | 0 | 0 | 0 | 0 | 23 |
7a5672dae65c7771cc160bc0ef36a606c64ee1ac | 679 | py | Python | modbus_client/types.py | KrystianD/modbus_client | 0dfae4933f3745d184a057d65f8d394a895e4580 | [
"MIT"
] | null | null | null | modbus_client/types.py | KrystianD/modbus_client | 0dfae4933f3745d184a057d65f8d394a895e4580 | [
"MIT"
] | null | null | null | modbus_client/types.py | KrystianD/modbus_client | 0dfae4933f3745d184a057d65f8d394a895e4580 | [
"MIT"
] | null | null | null | from typing import Union
RegisterValue = Union[int, bool]
__all__ = [
"RegisterType",
"ModbusReadSession",
"RegisterValueType",
]
| 18.351351 | 95 | 0.680412 | from dataclasses import dataclass, field
from enum import Enum
from typing import Dict, Tuple, Union
class RegisterType(Enum):
Coil = 1
DiscreteInputs = 2
InputRegister = 4
HoldingRegister = 5
class RegisterValueType(str, Enum):
S16 = 'int16'
U16 = 'uint16'
S32BE = 'int32be'
S32LE = ... | 0 | 110 | 0 | 275 | 0 | 0 | 0 | 32 | 113 |
15322b73bc8a724ee64d588d51570a6786ab1c00 | 9,950 | py | Python | gimmemotifs/config.py | littleblackfish/gimmemotifs | 913a6e5db378493155273e2c0f8ab0dc11ab219e | [
"MIT"
] | null | null | null | gimmemotifs/config.py | littleblackfish/gimmemotifs | 913a6e5db378493155273e2c0f8ab0dc11ab219e | [
"MIT"
] | null | null | null | gimmemotifs/config.py | littleblackfish/gimmemotifs | 913a6e5db378493155273e2c0f8ab0dc11ab219e | [
"MIT"
] | null | null | null | # Copyright (c) 2009-2016 Simon van Heeringen <simon.vanheeringen@gmail.com>
#
# This module is free software. You can redistribute it and/or modify it under
# the terms of the MIT License, see the file COPYING included with this
# distribution.
""" Configuration for GimmeMotifs """
import xdg
import os
import loggin... | 33.056478 | 178 | 0.565729 | # Copyright (c) 2009-2016 Simon van Heeringen <simon.vanheeringen@gmail.com>
#
# This module is free software. You can redistribute it and/or modify it under
# the terms of the MIT License, see the file COPYING included with this
# distribution.
""" Configuration for GimmeMotifs """
import configparser
import sysconf... | 0 | 0 | 0 | 7,310 | 0 | 0 | 0 | -10 | 155 |
88f1fe9b11b63cec1989aac27dd795cfa5c003ea | 1,672 | py | Python | accounts/migrations/0002_profile_address_profile_birthday_profile_city_and_more.py | sisekelohub/sisekelo | 7e1b0de6abf07e65ed746d0d929c3de37fb421c3 | [
"MIT"
] | 1 | 2022-02-20T16:03:04.000Z | 2022-02-20T16:03:04.000Z | accounts/migrations/0002_profile_address_profile_birthday_profile_city_and_more.py | sisekelohub/sisekelo | 7e1b0de6abf07e65ed746d0d929c3de37fb421c3 | [
"MIT"
] | null | null | null | accounts/migrations/0002_profile_address_profile_birthday_profile_city_and_more.py | sisekelohub/sisekelo | 7e1b0de6abf07e65ed746d0d929c3de37fb421c3 | [
"MIT"
] | null | null | null | # Generated by Django 4.0 on 2022-01-08 14:12
| 32.784314 | 170 | 0.577153 | # Generated by Django 4.0 on 2022-01-08 14:12
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('auth', '0012_alter_user_first_name_max_length'),
('accounts', '0001_initial'),
]
operations = [
migra... | 0 | 0 | 0 | 1,527 | 0 | 0 | 0 | 30 | 68 |
7dd2d6b8573dbbcc19896501a41ba515956ebaa6 | 1,007 | py | Python | button-led.py | InitialState/piot-101 | 434ddcde3da6ade4c9fd5ce9ee248661dda649df | [
"MIT"
] | 49 | 2015-04-23T00:48:13.000Z | 2016-08-07T18:26:23.000Z | button-led.py | InitialState/piot-101 | 434ddcde3da6ade4c9fd5ce9ee248661dda649df | [
"MIT"
] | null | null | null | button-led.py | InitialState/piot-101 | 434ddcde3da6ade4c9fd5ce9ee248661dda649df | [
"MIT"
] | 21 | 2015-03-26T01:57:05.000Z | 2016-06-28T00:19:05.000Z | # Import library that lets you control the Pi's GPIO pins
import RPi.GPIO as io
# Import time for delays
from time import sleep
# Disables messages about GPIO pins already being in use
io.setwarnings(False)
# Numbering scheme that corresponds to breakout board and pin layout
io.setmode(io.BCM)
led_io_pin = 17
butto... | 26.5 | 68 | 0.711023 | # Import library that lets you control the Pi's GPIO pins
import RPi.GPIO as io
# Import time for delays
from time import sleep
# Disables messages about GPIO pins already being in use
io.setwarnings(False)
# Numbering scheme that corresponds to breakout board and pin layout
io.setmode(io.BCM)
led_io_pin = 17
butto... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1a619a87f68ed772f96359ba80920b880851dad1 | 179 | py | Python | Init_Guide/urllib-use/urlread.py | coedfetr/STTP-python | 607d5c03e233dd7c6938ea2495a04701dcf5aed6 | [
"Apache-2.0"
] | null | null | null | Init_Guide/urllib-use/urlread.py | coedfetr/STTP-python | 607d5c03e233dd7c6938ea2495a04701dcf5aed6 | [
"Apache-2.0"
] | null | null | null | Init_Guide/urllib-use/urlread.py | coedfetr/STTP-python | 607d5c03e233dd7c6938ea2495a04701dcf5aed6 | [
"Apache-2.0"
] | 4 | 2015-12-24T05:34:46.000Z | 2020-03-10T03:39:16.000Z | import urllib2
url = "http://www.google.com/"
# get response from url
response = urllib2.urlopen(url)
fh = open('downloaded_file.html', "w")
fh.write(response.read())
fh.close()
| 19.888889 | 38 | 0.709497 | import urllib2
url = "http://www.google.com/"
# get response from url
response = urllib2.urlopen(url)
fh = open('downloaded_file.html', "w")
fh.write(response.read())
fh.close()
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6f337fb10d17c5a0e4f8224a7f0706f7b9400a77 | 2,517 | py | Python | python/ray/rllib/optimizers/sample_batch.py | rickyHong/Ray-repl | 24b93b11231fe627c4b4527535ae0c83a99485f8 | [
"Apache-2.0"
] | 1 | 2020-06-25T18:17:10.000Z | 2020-06-25T18:17:10.000Z | python/ray/rllib/optimizers/sample_batch.py | rickyHong/Ray-Population-Based-Training-repl | 195a42f2fa4ab39d1e2260e6860d88c529023655 | [
"Apache-2.0"
] | null | null | null | python/ray/rllib/optimizers/sample_batch.py | rickyHong/Ray-Population-Based-Training-repl | 195a42f2fa4ab39d1e2260e6860d88c529023655 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
| 28.602273 | 78 | 0.516091 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from functools import reduce
import numpy as np
class SampleBatch(object):
"""Wrapper around a dictionary with string keys and array-like values.
For example, {"obs": [1, 2, 3], "reward": [0, -1, 1]... | 0 | 82 | 0 | 2,252 | 0 | 0 | 0 | 4 | 69 |
8555dca20344c5d950662b1d2d705c224aaf832a | 25,040 | py | Python | fastNLP/embeddings/static_embedding.py | LouChao98/fastNLP | 78838268f80156bf5fe85623ac28451e2aa6963c | [
"Apache-2.0"
] | null | null | null | fastNLP/embeddings/static_embedding.py | LouChao98/fastNLP | 78838268f80156bf5fe85623ac28451e2aa6963c | [
"Apache-2.0"
] | null | null | null | fastNLP/embeddings/static_embedding.py | LouChao98/fastNLP | 78838268f80156bf5fe85623ac28451e2aa6963c | [
"Apache-2.0"
] | null | null | null | r"""
.. todo::
doc
"""
__all__ = ["StaticEmbedding"]
import torch.nn as nn
VOCAB_FILENAME = 'vocab.txt'
STATIC_HYPER_FILENAME = 'static_hyper.json'
STATIC_EMBED_FILENAME = 'static.txt'
| 45.280289 | 123 | 0.527436 | r"""
.. todo::
doc
"""
__all__ = ["StaticEmbedding"]
import os
import warnings
from collections import defaultdict
from copy import deepcopy
import json
from typing import Union
import numpy as np
import torch
import torch.nn as nn
from .embedding import TokenEmbedding
from ..core import logger
from ..core.vocab... | 3,348 | 920 | 0 | 22,383 | 0 | 0 | 0 | 118 | 311 |
e10f620dbefc02cdce5c4fd1550202222c1672c3 | 6,574 | py | Python | lib/need2merge/ghunt.py | razberries/saudtool.py | fc19ac8ae39a28d6be09ad5ea15da15f5933eca6 | [
"MIT"
] | null | null | null | lib/need2merge/ghunt.py | razberries/saudtool.py | fc19ac8ae39a28d6be09ad5ea15da15f5933eca6 | [
"MIT"
] | 1 | 2020-12-12T18:38:46.000Z | 2020-12-12T18:38:46.000Z | lib/need2merge/ghunt.py | razberries/saudtool.py | fc19ac8ae39a28d6be09ad5ea15da15f5933eca6 | [
"MIT"
] | null | null | null | #This was not made by me although I'm putting this here to implement into Saudtool
#!/usr/bin/env python3
import json
import sys
import os
from datetime import datetime
from io import BytesIO
from os.path import isfile
from pathlib import Path
import httpx
from PIL import Image
from geopy.geocoders import Nominatim
... | 35.344086 | 131 | 0.55826 | #This was not made by me although I'm putting this here to implement into Saudtool
#!/usr/bin/env python3
import json
import sys
import os
from datetime import datetime
from io import BytesIO
from os.path import isfile
from pathlib import Path
from pprint import pprint
import httpx
from PIL import Image
from geopy.ge... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 13 | 66 |
8668bcaa5f1acd566fb6e05c56abb01008aad177 | 444 | py | Python | setup.py | artisoft-io/jetstore | 84f8b5d82bbc8fa309571c431a7674ef3ff0e9c2 | [
"Apache-2.0"
] | null | null | null | setup.py | artisoft-io/jetstore | 84f8b5d82bbc8fa309571c431a7674ef3ff0e9c2 | [
"Apache-2.0"
] | 61 | 2021-12-29T15:02:53.000Z | 2022-03-31T14:53:40.000Z | setup.py | artisoft-io/jetstore | 84f8b5d82bbc8fa309571c431a7674ef3ff0e9c2 | [
"Apache-2.0"
] | null | null | null | from setuptools import setup
setup(
name='jetstore',
author='ArtiSoft',
version='1.0',
python_requires='>=3.9',
install_requires=['absl-py', 'apsw', 'antlr4-python3-runtime'],
packages=['jets', 'jets.bridge', 'jets.compiler'],
package_data = {
'jets.bridge': ['jetrule_rete_test.db'],
'jets.compil... | 26.117647 | 74 | 0.646396 | from setuptools import setup
setup(
name='jetstore',
author='ArtiSoft',
version='1.0',
python_requires='>=3.9',
install_requires=['absl-py', 'apsw', 'antlr4-python3-runtime'],
packages=['jets', 'jets.bridge', 'jets.compiler'],
package_data = {
'jets.bridge': ['jetrule_rete_test.db'],
'jets.compil... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9f09ebc8cde19c25c442d790223e4857cddc2224 | 9,223 | py | Python | examples/example_Voronoi_rods_FEA_2.py | qiancao/BoneBox | 0d10dac7c93f16f0643bebc62c63be2f4bd099f6 | [
"BSD-3-Clause"
] | 1 | 2022-03-11T20:49:19.000Z | 2022-03-11T20:49:19.000Z | examples/example_Voronoi_rods_FEA_2.py | qiancao/BoneBox | 0d10dac7c93f16f0643bebc62c63be2f4bd099f6 | [
"BSD-3-Clause"
] | null | null | null | examples/example_Voronoi_rods_FEA_2.py | qiancao/BoneBox | 0d10dac7c93f16f0643bebc62c63be2f4bd099f6 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon May 17 11:55:11 2021
@author: Qian.Cao
Generate a series of Voronoi Rod (AND PLATE) phantoms
"""
import sys
sys.path.append('../') # use bonebox from source without having to install/build
import numpy as np
import matplotlib.pyplot as plt
# import mcubes
plt.ion()
print... | 32.475352 | 114 | 0.625285 | # -*- coding: utf-8 -*-
"""
Created on Mon May 17 11:55:11 2021
@author: Qian.Cao
Generate a series of Voronoi Rod (AND PLATE) phantoms
"""
import sys
sys.path.append('../') # use bonebox from source without having to install/build
from bonebox.phantoms.TrabeculaeVoronoi import *
import numpy as np
import matplotl... | 0 | 0 | 0 | 0 | 0 | 2,967 | 0 | 35 | 93 |
90967ceac812860e815eeadbc5130b1e5b84a7cd | 2,944 | py | Python | pluploader/safemode.py | craftamap/pluploader | c44e683282abb6fba8ced156aa807a66736a4ca1 | [
"Apache-2.0"
] | 12 | 2020-04-09T12:50:23.000Z | 2020-10-30T14:43:40.000Z | pluploader/safemode.py | livelyapps/pluploader | 39f2f50ba9625c038cdb1f5a7ecf2ad64da5577c | [
"Apache-2.0"
] | 40 | 2020-04-12T15:25:46.000Z | 2021-06-04T19:47:44.000Z | pluploader/safemode.py | craftamap/pluploader | c44e683282abb6fba8ced156aa807a66736a4ca1 | [
"Apache-2.0"
] | 2 | 2020-09-16T14:07:49.000Z | 2020-10-30T14:45:07.000Z | import typer
app_safemode = typer.Typer()
| 34.232558 | 120 | 0.655571 | import logging
import sys
import requests
import typer
from colorama import Fore
from .upm.upmapi import UpmApi
from .util import browser
app_safemode = typer.Typer()
@app_safemode.callback()
def safemode(ctx: typer.Context):
"""Controls the upm safemode"""
@app_safemode.command("status")
def safemode_status... | 0 | 2,678 | 0 | 0 | 0 | 0 | 0 | -7 | 226 |
eaf5f7baf42e643675e764ff3ff600958c1c7acb | 5,589 | py | Python | imola/classes.py | mp4096/imola | dc373f3725a216d12d54015b2757e1f45d6fc6ef | [
"BSD-3-Clause"
] | null | null | null | imola/classes.py | mp4096/imola | dc373f3725a216d12d54015b2757e1f45d6fc6ef | [
"BSD-3-Clause"
] | null | null | null | imola/classes.py | mp4096/imola | dc373f3725a216d12d54015b2757e1f45d6fc6ef | [
"BSD-3-Clause"
] | null | null | null | """Ground truth generator for lane estimator benchmarking."""
| 36.058065 | 79 | 0.613705 | """Ground truth generator for lane estimator benchmarking."""
import codecs
import numpy as np
from scipy.interpolate import splev, splprep
import yaml
from .views import filter_within_frame
def load_yaml(filename):
with codecs.open(filename, "r", encoding="utf-8") as f:
data = yaml.load(f)
return dat... | 4 | 0 | 0 | 5,145 | 0 | 107 | 0 | 19 | 248 |
698767c9f76a8f03ac27b350b6ae6175d5de510b | 1,377 | py | Python | winton_kafka_streams/state/factory/value_store_factory.py | wintoncode/winton-kafka-streams | 5867a1c42fc80bba07173fd1d004b2849b429fdf | [
"Apache-2.0"
] | 330 | 2017-07-12T09:05:43.000Z | 2022-03-14T06:44:59.000Z | winton_kafka_streams/state/factory/value_store_factory.py | sribarrow/winton-kafka-streams | 5867a1c42fc80bba07173fd1d004b2849b429fdf | [
"Apache-2.0"
] | 39 | 2017-07-13T10:36:07.000Z | 2021-06-14T06:28:38.000Z | winton_kafka_streams/state/factory/value_store_factory.py | sribarrow/winton-kafka-streams | 5867a1c42fc80bba07173fd1d004b2849b429fdf | [
"Apache-2.0"
] | 71 | 2017-07-12T10:51:55.000Z | 2021-12-28T08:57:10.000Z | from typing import TypeVar
KT = TypeVar('KT') # Key type.
VT = TypeVar('VT') # Value type.
| 37.216216 | 83 | 0.721133 | from typing import TypeVar, Generic
from winton_kafka_streams.processor.serialization import Serde
from winton_kafka_streams.processor.serialization.serdes import *
from .key_value_store_factory import KeyValueStoreFactory
KT = TypeVar('KT') # Key type.
VT = TypeVar('VT') # Value type.
class ValueStoreFactory(Gen... | 0 | 0 | 0 | 1,062 | 0 | 0 | 0 | 130 | 90 |
ed9ea6a2c1caa5f94ab0af629390508aeb55cdbf | 19 | py | Python | djangoPharma/env/Lib/site-packages/suit/__init__.py | thodoris/djangoPharma | 76089e67bc9940651a876d078879469127f5ac66 | [
"Apache-2.0"
] | null | null | null | djangoPharma/env/Lib/site-packages/suit/__init__.py | thodoris/djangoPharma | 76089e67bc9940651a876d078879469127f5ac66 | [
"Apache-2.0"
] | null | null | null | djangoPharma/env/Lib/site-packages/suit/__init__.py | thodoris/djangoPharma | 76089e67bc9940651a876d078879469127f5ac66 | [
"Apache-2.0"
] | null | null | null | VERSION = '0.2.25'
| 9.5 | 18 | 0.578947 | VERSION = '0.2.25'
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0edf557d3cecb4123a38b8aa3a36ce0735bc60dd | 4,788 | py | Python | aeg-analysis/aeg/command.py | Albocoder/KOOBE | dd8acade05b0185771e1ea9950de03ab5445a981 | [
"MIT"
] | 55 | 2019-12-20T03:25:14.000Z | 2022-01-16T07:19:47.000Z | aeg-analysis/aeg/command.py | Albocoder/KOOBE | dd8acade05b0185771e1ea9950de03ab5445a981 | [
"MIT"
] | 2 | 2020-11-02T08:01:00.000Z | 2022-03-27T02:59:18.000Z | aeg-analysis/aeg/command.py | Albocoder/KOOBE | dd8acade05b0185771e1ea9950de03ab5445a981 | [
"MIT"
] | 11 | 2020-08-06T03:59:45.000Z | 2022-02-25T02:31:59.000Z | import logging
logger = logging.getLogger(__name__)
RET_INTERRUPT = -1
RET_TIMEOUT = -2
| 29.925 | 121 | 0.546992 | import os
import json
import subprocess
import sys
import logging
import psutil
from subprocess import TimeoutExpired, STDOUT
logger = logging.getLogger(__name__)
RET_INTERRUPT = -1
RET_TIMEOUT = -2
class Command(object):
def __init__(self, _parser):
self.parser = _parser
self.parser.add_argum... | 0 | 0 | 0 | 4,528 | 0 | 0 | 0 | -21 | 179 |
c1e89e4eea90232292c018831e1bfbcf2491de2d | 45,977 | py | Python | admin/modmanager.py | Dankr4d/modmanager | 0958a1f09bd0658a9868f25510fd16634c3915b5 | [
"Artistic-1.0"
] | 2 | 2017-06-27T10:37:53.000Z | 2019-10-08T10:03:42.000Z | admin/modmanager.py | Dankr4d/modmanager | 0958a1f09bd0658a9868f25510fd16634c3915b5 | [
"Artistic-1.0"
] | null | null | null | admin/modmanager.py | Dankr4d/modmanager | 0958a1f09bd0658a9868f25510fd16634c3915b5 | [
"Artistic-1.0"
] | 7 | 2016-07-23T19:57:15.000Z | 2021-03-02T19:13:46.000Z | # vim: ts=4 sw=4 noexpandtab
"""Battlefield -- ModManager.
This is a Module Manager for BattleField
It enables users to add and remove modules dynamicly using
a centralised configuration which is multi server friendly.
The location of the config file modmanager.con is determined by the directory identified
by +confi... | 29.586229 | 224 | 0.670705 | # vim: ts=4 sw=4 noexpandtab
"""Battlefield -- ModManager.
This is a Module Manager for BattleField
It enables users to add and remove modules dynamicly using
a centralised configuration which is multi server friendly.
The location of the config file modmanager.con is determined by the directory identified
by +confi... | 0 | 0 | 0 | 38,279 | 0 | 0 | 0 | -39 | 201 |
22cca791638c3ae0708ae78f05bc69faf6de9bcf | 1,924 | py | Python | migrations/versions/2268d72d8102_users_migration.py | fernandoleira/lps-platform | 0d2ac2465c27444e184bbe5357553607b37790da | [
"MIT"
] | null | null | null | migrations/versions/2268d72d8102_users_migration.py | fernandoleira/lps-platform | 0d2ac2465c27444e184bbe5357553607b37790da | [
"MIT"
] | null | null | null | migrations/versions/2268d72d8102_users_migration.py | fernandoleira/lps-platform | 0d2ac2465c27444e184bbe5357553607b37790da | [
"MIT"
] | null | null | null | """Users Migration
Revision ID: 2268d72d8102
Revises: 94ee4bd6a597
Create Date: 2021-09-15 17:21:21.280507
"""
# revision identifiers, used by Alembic.
revision = '2268d72d8102'
down_revision = '94ee4bd6a597'
branch_labels = None
depends_on = None
| 35.62963 | 95 | 0.691788 | """Users Migration
Revision ID: 2268d72d8102
Revises: 94ee4bd6a597
Create Date: 2021-09-15 17:21:21.280507
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = '2268d72d8102'
down_revision = '94ee4bd6a597'
branch_labels = No... | 0 | 0 | 0 | 0 | 0 | 1,535 | 0 | 24 | 112 |
30336d5953c685219a4b5cbe99f3bc5e8f09466a | 2,274 | py | Python | helga_stfu.py | shaunduncan/helga-stfu | 9d805da48389abdadc410ab35d85438e26c263a9 | [
"MIT"
] | 1 | 2016-10-12T15:37:42.000Z | 2016-10-12T15:37:42.000Z | helga_stfu.py | shaunduncan/helga-stfu | 9d805da48389abdadc410ab35d85438e26c263a9 | [
"MIT"
] | null | null | null | helga_stfu.py | shaunduncan/helga-stfu | 9d805da48389abdadc410ab35d85438e26c263a9 | [
"MIT"
] | null | null | null |
silence_acks = (
u'silence is golden',
u'shutting up',
u'biting my tongue',
u'fine, whatever',
)
unsilence_acks = (
u'speaking once again',
u'did you miss me?',
u'FINALLY',
u'thanks {nick}, i was getting bored'
)
snarks = (
u'why would you want to do that {nick}?',
u'do you r... | 27.071429 | 99 | 0.586192 | import random
import re
from twisted.internet import reactor
from helga.plugins import command, preprocessor
silence_acks = (
u'silence is golden',
u'shutting up',
u'biting my tongue',
u'fine, whatever',
)
unsilence_acks = (
u'speaking once again',
u'did you miss me?',
u'FINALLY',
u... | 0 | 1,427 | 0 | 0 | 0 | 198 | 0 | 21 | 136 |
23037ab7e793a472713d75532b345d040a7661a3 | 4,338 | py | Python | test/unit/mysql_libs/is_cfg_valid.py | deepcoder42/mysql-lib | d3d2459e0476fdbc4465e1d9389612e58d36fb25 | [
"MIT"
] | 1 | 2022-03-23T04:53:19.000Z | 2022-03-23T04:53:19.000Z | test/unit/mysql_libs/is_cfg_valid.py | deepcoder42/mysql-lib | d3d2459e0476fdbc4465e1d9389612e58d36fb25 | [
"MIT"
] | null | null | null | test/unit/mysql_libs/is_cfg_valid.py | deepcoder42/mysql-lib | d3d2459e0476fdbc4465e1d9389612e58d36fb25 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# Classification (U)
"""Program: is_cfg_valid.py
Description: Unit testing of is_cfg_valid in mysql_libs.py.
Usage:
test/unit/mysql_libs/is_cfg_valid.py
Arguments:
"""
# Libraries and Global Variables
# Standard
import sys
import os
if sys.version_info < (2, 7):
impor... | 22.476684 | 77 | 0.625403 | #!/usr/bin/python
# Classification (U)
"""Program: is_cfg_valid.py
Description: Unit testing of is_cfg_valid in mysql_libs.py.
Usage:
test/unit/mysql_libs/is_cfg_valid.py
Arguments:
"""
# Libraries and Global Variables
# Standard
import sys
import os
if sys.version_info < (2, 7):
impor... | 0 | 1,828 | 0 | 1,910 | 0 | 0 | 0 | -14 | 90 |
bcd045e7e2093b0e69c545d93e935d6d86f433e7 | 3,626 | py | Python | KnowledgeGraph/article_nodes_relational_to_graph_wikidata.py | JTischbein/KGL-ChemicalCompounds-CC | f7abc8956c89878c9c124460f9dbc73820ea1e52 | [
"MIT"
] | null | null | null | KnowledgeGraph/article_nodes_relational_to_graph_wikidata.py | JTischbein/KGL-ChemicalCompounds-CC | f7abc8956c89878c9c124460f9dbc73820ea1e52 | [
"MIT"
] | 2 | 2022-03-18T21:40:42.000Z | 2022-03-18T22:39:31.000Z | KnowledgeGraph/article_nodes_relational_to_graph_wikidata.py | JTischbein/KGL-ChemicalCompounds-CC | f7abc8956c89878c9c124460f9dbc73820ea1e52 | [
"MIT"
] | null | null | null | from Database import Database
if __name__ == "__main__":
db = Database("../config.ini").connect()
config = ConfigParser()
config.read("../config.ini")
graph = KGL_graph(config["NEO4J"]["GRAPH_HOST"], config["NEO4J"]["GRAPH_USER"], config["NEO4J"]["GRAPH_PASSWORD"])
articles =... | 56.65625 | 230 | 0.680364 | from neo4j import GraphDatabase
from Database import Database
class KGL_graph:
def __init__(self, uri, user, password):
self.driver = GraphDatabase.driver(uri, auth=(user, password))
def close(self):
self.driver.close()
def write_node(self, articleID, link, content, date, lang... | 4 | 0 | 0 | 1,379 | 0 | 0 | 0 | 10 | 48 |
2b6814d26f56fe3104f0f78258adfaaddf62bacb | 5,052 | py | Python | MIDIConverter.py | bluntano/discord-midi-player | f164d0892730639d7b0097ed52ea700a51436414 | [
"MIT"
] | 5 | 2020-08-08T22:19:57.000Z | 2021-11-27T19:23:22.000Z | MIDIConverter.py | bluntano/discord-midi-player | f164d0892730639d7b0097ed52ea700a51436414 | [
"MIT"
] | 3 | 2021-02-22T14:15:00.000Z | 2021-11-18T22:20:55.000Z | MIDIConverter.py | bluntano/discord-midi-player | f164d0892730639d7b0097ed52ea700a51436414 | [
"MIT"
] | 4 | 2020-04-24T23:20:25.000Z | 2022-03-18T16:13:11.000Z | ################################
# MIT License #
# ---------------------------- #
# Copyright (c) 2021 Bluntano #
################################
# for debugging info
from pytz import timezone
tz = timezone('UTC')
soundfonts = []
DEBUG = False
| 34.135135 | 93 | 0.517023 | ################################
# MIT License #
# ---------------------------- #
# Copyright (c) 2021 Bluntano #
################################
import os
import json
import requests # for downloading MIDI file from link
import audio_metadata # for checking converted WAV metadata
from midi2audio imp... | 0 | 0 | 0 | 4,541 | 0 | 0 | 0 | -8 | 254 |
1b9d2d198ebde5eb92be4ed2e1641ce5696098fb | 1,884 | py | Python | tools/auto_build.py | zaojiahua/packserver | 4cccc3cf5fc731276b5ac7324df9b12915175bd1 | [
"Apache-2.0"
] | null | null | null | tools/auto_build.py | zaojiahua/packserver | 4cccc3cf5fc731276b5ac7324df9b12915175bd1 | [
"Apache-2.0"
] | null | null | null | tools/auto_build.py | zaojiahua/packserver | 4cccc3cf5fc731276b5ac7324df9b12915175bd1 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# san_slg
import os
import sys
# #
# LOCAL_UPDATE_PATH = "/Users/san/packserver/bin/Update_server_"
# #
# INTRANET_UPDATE_PATN = "10.241.107.31:/app/frontPack/intratest/"
# #
# EXTRANET_UPDATE_PATH = "10.241.107.31:/"
# Python Python
NDK_PATH = "/Users/san/enviroment/sdk/ndk-bundle"
NDK_MODULE_P... | 35.54717 | 176 | 0.707006 | # coding=utf-8
# 服务器打包外部包装的一个脚本 内部调用san_slg工程下面的脚本
import os
import sys
from file_utils import *
# # 定义本地热更新目录
# LOCAL_UPDATE_PATH = "/Users/san/packserver/bin/Update_server_"
# # 定义内网热跟新目录
# INTRANET_UPDATE_PATN = "10.241.107.31:/app/frontPack/intratest/"
# # 定义外网热更新目录
# EXTRANET_UPDATE_PATH = "10.241.107.31:/"
# ... | 360 | 0 | 0 | 0 | 0 | 0 | 0 | 3 | 22 |
05342619b1750fecc1b44c911b0f8237dcd779e1 | 7,108 | py | Python | tests/system_check/common_lib.py | yoiwa-personal/suid_sudo | 18db5ded769305b4d22ca117511434a1d4be9c36 | [
"Apache-2.0"
] | null | null | null | tests/system_check/common_lib.py | yoiwa-personal/suid_sudo | 18db5ded769305b4d22ca117511434a1d4be9c36 | [
"Apache-2.0"
] | null | null | null | tests/system_check/common_lib.py | yoiwa-personal/suid_sudo | 18db5ded769305b4d22ca117511434a1d4be9c36 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3 -I
from __future__ import print_function # python2
import sys
import os
# check system behavior for suid-sudo
if sys.version_info[0] == 2:
_ispython2 = True
if sys.version_info < (2, 7, 13):
raise RuntimeError("too old python2 version")
else:
pass
else:
_ispython2 =... | 27.338462 | 117 | 0.531936 | #!/usr/bin/python3 -I
from __future__ import print_function # python2
import sys
import os
import os.path
import pwd
import grp
import tempfile
import shutil
# check system behavior for suid-sudo
if sys.version_info[0] == 2:
_ispython2 = True
if sys.version_info < (2, 7, 13):
raise RuntimeError("too ... | 0 | 0 | 0 | -8 | 0 | 5,800 | 0 | -52 | 435 |
7d2d84bda6617e9c25ac8923e9c55157b39a7b4a | 2,298 | py | Python | python_module/megengine/distributed/helper.py | stoneMo/MegEngine | 4b55350dd0a5e7d9aef3c25f10c4b6c0d47f7ac7 | [
"Apache-2.0"
] | 1 | 2020-10-12T11:09:46.000Z | 2020-10-12T11:09:46.000Z | python_module/megengine/distributed/helper.py | stoneMo/MegEngine | 4b55350dd0a5e7d9aef3c25f10c4b6c0d47f7ac7 | [
"Apache-2.0"
] | null | null | null | python_module/megengine/distributed/helper.py | stoneMo/MegEngine | 4b55350dd0a5e7d9aef3c25f10c4b6c0d47f7ac7 | [
"Apache-2.0"
] | 1 | 2022-02-21T10:41:55.000Z | 2022-02-21T10:41:55.000Z | # -*- coding: utf-8 -*-
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
#
# Copyright (c) 2014-2020 Megvii Inc. All rights reserved.
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT ARRANTI... | 35.90625 | 88 | 0.697563 | # -*- coding: utf-8 -*-
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
#
# Copyright (c) 2014-2020 Megvii Inc. All rights reserved.
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT ARRANTI... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 27 | 0 |
ed6f53b6b53eeb60aab300425a07114f1ea3ccdf | 2,149 | py | Python | flask-api/app.py | jaeyow/f1-predictor | 88dba679ed4b1b6763dc4654f8ddacc1187cee47 | [
"MIT"
] | null | null | null | flask-api/app.py | jaeyow/f1-predictor | 88dba679ed4b1b6763dc4654f8ddacc1187cee47 | [
"MIT"
] | null | null | null | flask-api/app.py | jaeyow/f1-predictor | 88dba679ed4b1b6763dc4654f8ddacc1187cee47 | [
"MIT"
] | null | null | null | from flask import Flask
import pickle
# this is our machine learning model
model = pickle.load(open('f1-model.pkl','rb'))
app = Flask(__name__)
| 35.229508 | 123 | 0.652396 | from flask import Flask, jsonify, make_response, request
import pandas as pd
import numpy as np
from timeit import default_timer as timer
import pickle
# this is our machine learning model
model = pickle.load(open('f1-model.pkl','rb'))
app = Flask(__name__)
@app.route('/predict',methods = ['POST', 'GET'])
def predict... | 0 | 1,573 | 0 | 246 | 0 | 0 | 0 | 48 | 135 |
fd24abdeb0c4e0e4405902cec47525bc5a6340b5 | 837 | py | Python | Assignment/Assignment 3/LogisticRegression.py | SCGTall/CS6375MachineLearning | 50ff7348eb583113b17084775a8679ce135c0487 | [
"MIT"
] | null | null | null | Assignment/Assignment 3/LogisticRegression.py | SCGTall/CS6375MachineLearning | 50ff7348eb583113b17084775a8679ce135c0487 | [
"MIT"
] | null | null | null | Assignment/Assignment 3/LogisticRegression.py | SCGTall/CS6375MachineLearning | 50ff7348eb583113b17084775a8679ce135c0487 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import Assignment3 as a3
print("Start training...")
voc, train_counts = a3.buildVocabulary(False) # do not ignore stop words
x, y, socket = a3.generateXY(voc)
hard_limit = 50
lbds = [0.01, 0.02, 0.05, 0.1] # 0.01-0.1
lr = 0.01
w0 = [1.0 for _ in range(len(voc) + 1)]
for lbd in lbds:
w = a... | 39.857143 | 106 | 0.64994 | # -*- coding: utf-8 -*-
import Assignment3 as a3
print("Start training...")
voc, train_counts = a3.buildVocabulary(False) # do not ignore stop words
x, y, socket = a3.generateXY(voc)
hard_limit = 50
lbds = [0.01, 0.02, 0.05, 0.1] # 0.01-0.1
lr = 0.01
w0 = [1.0 for _ in range(len(voc) + 1)]
for lbd in lbds:
w = a... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ee55ef217a42277be51ccc7e4fb2a2d176ea2b55 | 176 | py | Python | ProjectEuler/Python/ChampernownesConstant.py | dfm066/Programming | 53d28460cd40b966cca1d4695d9dc6792ced4c6f | [
"MIT"
] | null | null | null | ProjectEuler/Python/ChampernownesConstant.py | dfm066/Programming | 53d28460cd40b966cca1d4695d9dc6792ced4c6f | [
"MIT"
] | null | null | null | ProjectEuler/Python/ChampernownesConstant.py | dfm066/Programming | 53d28460cd40b966cca1d4695d9dc6792ced4c6f | [
"MIT"
] | null | null | null | digc = [1,10,100,1000,10000,100000,1000000]
fraction = ""
prod = 1
for i in range(10**18):
fraction += str(i)
for j in digc:
prod *= int(fraction[j])
print(prod) | 22 | 44 | 0.607955 | digc = [1,10,100,1000,10000,100000,1000000]
fraction = ""
prod = 1
for i in range(10**18):
fraction += str(i)
for j in digc:
prod *= int(fraction[j])
print(prod) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3bb1f92df082d24b0ff5dfcc3ae4d59e533fb3b3 | 2,752 | py | Python | rllib/examples/multi_agent_custom_policy.py | kifarid/ray | 43c97c2afb979987be82fa50048674e9b6776d5d | [
"Apache-2.0"
] | 3 | 2021-08-29T20:41:21.000Z | 2022-01-31T18:47:51.000Z | rllib/examples/multi_agent_custom_policy.py | QPC-database/amazon-ray | 55aa4cac02a412b96252aea4e8c3f177a28324a1 | [
"Apache-2.0"
] | 64 | 2021-06-19T07:06:15.000Z | 2022-03-26T07:13:16.000Z | rllib/examples/multi_agent_custom_policy.py | QPC-database/amazon-ray | 55aa4cac02a412b96252aea4e8c3f177a28324a1 | [
"Apache-2.0"
] | null | null | null | """Example of running a custom hand-coded policy alongside trainable policies.
This example has two policies:
(1) a simple PG policy
(2) a hand-coded policy that acts at random in the env (doesn't learn)
In the console output, you can see the PG policy does much better than random:
Result for PG_multi_cartpol... | 29.276596 | 78 | 0.650073 | """Example of running a custom hand-coded policy alongside trainable policies.
This example has two policies:
(1) a simple PG policy
(2) a hand-coded policy that acts at random in the env (doesn't learn)
In the console output, you can see the PG policy does much better than random:
Result for PG_multi_cartpol... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4bf08521408b6cd555579c53d6ef7e1d634328bb | 4,404 | py | Python | seisflows3-super/preprocess/pyatoa_nz.py | bch0w/seisflows | 30012d6e5a830ac257de6e006f17dd98f5fd6f43 | [
"BSD-2-Clause"
] | null | null | null | seisflows3-super/preprocess/pyatoa_nz.py | bch0w/seisflows | 30012d6e5a830ac257de6e006f17dd98f5fd6f43 | [
"BSD-2-Clause"
] | null | null | null | seisflows3-super/preprocess/pyatoa_nz.py | bch0w/seisflows | 30012d6e5a830ac257de6e006f17dd98f5fd6f43 | [
"BSD-2-Clause"
] | 4 | 2020-05-13T21:41:25.000Z | 2021-07-23T11:37:35.000Z | #!/usr/bin/env python
"""
This is the sub class seisflows.preprocess.PyatoaMaui
Slightly altered processing function for the New Zealand tomography scenario
"""
import sys
import pyatoa
from pyasdf import ASDFDataSet
from pyatoa.utils.read import read_station_codes
PAR = sys.modules["seisflows_parameters"]
PATH = sys... | 40.777778 | 80 | 0.659628 | #!/usr/bin/env python
"""
This is the sub class seisflows.preprocess.PyatoaMaui
Slightly altered processing function for the New Zealand tomography scenario
"""
import sys
import pyatoa
from pyasdf import ASDFDataSet
from seisflows3.config import custom_import
from pyatoa.utils.read import read_station_codes
PAR = sy... | 0 | 0 | 0 | 1,888 | 0 | 0 | 0 | 22 | 45 |
8bbba4b0a8a3e1dc7c235a930f13820affd5c9ce | 51,390 | py | Python | harness.py | mister-hai/autoharness | 2505de784d468e66d95dc8bb3f1a0477af454ce7 | [
"MIT"
] | null | null | null | harness.py | mister-hai/autoharness | 2505de784d468e66d95dc8bb3f1a0477af454ce7 | [
"MIT"
] | null | null | null | harness.py | mister-hai/autoharness | 2505de784d468e66d95dc8bb3f1a0477af454ce7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#!/usr/bin/python3.9
################################################################################
## Automated Fuzzing Harness Generator - Vintage 2021 Python 3.9 ##
################################################################################
# Licenced ... | 67.97619 | 937 | 0.54495 | # -*- coding: utf-8 -*-
#!/usr/bin/python3.9
################################################################################
## Automated Fuzzing Harness Generator - Vintage 2021 Python 3.9 ##
################################################################################
# Licenced ... | 0 | 0 | 0 | 8,932 | 0 | 562 | 0 | -1 | 199 |
d896776edfa5a2d7b53c4ca672b8755b3afe8237 | 14 | py | Python | settings/local_sttings_example.py | mysardor/marketbot | 194fe1c6a6c5b38c6dfb54959b5e9a6982aaa417 | [
"MIT"
] | 1 | 2017-03-28T13:17:01.000Z | 2017-03-28T13:17:01.000Z | settings/local_sttings_example.py | mysardor/marketbot | 194fe1c6a6c5b38c6dfb54959b5e9a6982aaa417 | [
"MIT"
] | null | null | null | settings/local_sttings_example.py | mysardor/marketbot | 194fe1c6a6c5b38c6dfb54959b5e9a6982aaa417 | [
"MIT"
] | 2 | 2020-01-04T14:31:00.000Z | 2020-02-24T14:58:05.000Z | BOT_TOKEN = '' | 14 | 14 | 0.642857 | BOT_TOKEN = '' | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
300ffe3dba383bceb0ea3949c064e2e3437bb08e | 753 | py | Python | example.py | groskopf/printerbox_pdf | 3212d39edb050cc09edb08ae9242578bd19530dd | [
"MIT"
] | null | null | null | example.py | groskopf/printerbox_pdf | 3212d39edb050cc09edb08ae9242578bd19530dd | [
"MIT"
] | null | null | null | example.py | groskopf/printerbox_pdf | 3212d39edb050cc09edb08ae9242578bd19530dd | [
"MIT"
] | null | null | null | from reportlab.lib.styles import getSampleStyleSheet
from reportlab.rl_config import defaultPageSize
PAGE_HEIGHT=defaultPageSize[1]
PAGE_WIDTH=defaultPageSize[0]
styles = getSampleStyleSheet()
# First we import some constructors, some paragraph styles and other conveniences from other modules.
Title = "Hello world"
p... | 35.857143 | 101 | 0.774236 | from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer
from reportlab.lib.styles import getSampleStyleSheet
from reportlab.rl_config import defaultPageSize
from reportlab.lib.units import inch
PAGE_HEIGHT=defaultPageSize[1]
PAGE_WIDTH=defaultPageSize[0]
styles = getSampleStyleSheet()
# First we import som... | 0 | 0 | 0 | 0 | 0 | 268 | 0 | 61 | 66 |
1660fff95c23ef2f19d2a573c526653b17c5398e | 1,519 | py | Python | Shared_Processors/PackageInfoVersioner.py | andrewjharms/Recipes-for-AutoPkg | b16e86294936222c4ab106fe0c0e11f9744ba9c9 | [
"BSD-3-Clause"
] | null | null | null | Shared_Processors/PackageInfoVersioner.py | andrewjharms/Recipes-for-AutoPkg | b16e86294936222c4ab106fe0c0e11f9744ba9c9 | [
"BSD-3-Clause"
] | null | null | null | Shared_Processors/PackageInfoVersioner.py | andrewjharms/Recipes-for-AutoPkg | b16e86294936222c4ab106fe0c0e11f9744ba9c9 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
#
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
#
"""See docstring for... | 28.660377 | 77 | 0.700461 | #!/usr/bin/python
#
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
#
"""See docstring for... | 0 | 0 | 0 | 808 | 0 | 0 | 0 | 33 | 69 |
9a59070b823caef1b0c95b00b8717b8773cb491d | 33,956 | py | Python | im2txt/l2_attack.py | Bhaskers-Blu-Org1/Image-Captioning-Attack | b1f5a882e741819298f79b126d3f4314cfceaab7 | [
"Apache-2.0"
] | 62 | 2017-12-12T01:27:51.000Z | 2022-03-25T02:52:29.000Z | im2txt/l2_attack.py | Bhaskers-Blu-Org1/Image-Captioning-Attack | b1f5a882e741819298f79b126d3f4314cfceaab7 | [
"Apache-2.0"
] | 3 | 2018-09-25T07:11:07.000Z | 2020-04-17T15:04:50.000Z | im2txt/l2_attack.py | IBM/Image-Captioning-Attack | b1f5a882e741819298f79b126d3f4314cfceaab7 | [
"Apache-2.0"
] | 13 | 2018-08-13T08:32:50.000Z | 2020-10-03T00:36:19.000Z | ## l2_attack.py -- attack a network optimizing for l_2 distance
##
## Copyright (C) 2017, Hongge Chen <chenhg@mit.edu>.
## Copyright (C) 2017, Huan Zhang <ecezhang@ucdavis.edu>.
## Copyright (C) 2016, Nicholas Carlini <nicholas@carlini.com>.
##
## This program is licenced under the BSD 2-Clause licence,
## contained in... | 60.527629 | 466 | 0.621746 | ## l2_attack.py -- attack a network optimizing for l_2 distance
##
## Copyright (C) 2017, Hongge Chen <chenhg@mit.edu>.
## Copyright (C) 2017, Huan Zhang <ecezhang@ucdavis.edu>.
## Copyright (C) 2016, Nicholas Carlini <nicholas@carlini.com>.
##
## This program is licenced under the BSD 2-Clause licence,
## contained in... | 0 | 0 | 0 | 32,847 | 0 | 0 | 0 | 25 | 178 |
e3dcf8379bb02ae7270a4f3f1496bd7d0b81d7a6 | 6,891 | py | Python | src/main/resources/picard/analysis/sample_relatedness_network.py | markjschreiber/picard-1 | d784ca32864db72c821d38875fed7bea0524ab87 | [
"MIT"
] | null | null | null | src/main/resources/picard/analysis/sample_relatedness_network.py | markjschreiber/picard-1 | d784ca32864db72c821d38875fed7bea0524ab87 | [
"MIT"
] | null | null | null | src/main/resources/picard/analysis/sample_relatedness_network.py | markjschreiber/picard-1 | d784ca32864db72c821d38875fed7bea0524ab87 | [
"MIT"
] | null | null | null | import argparse
'''
Creates visualization of sample relatedness (using LOD scores from CrosscheckFingerprints)
Samples with low coverage at fingerprinting sites will be more opaque than other samples
Run command:
python3 sample_relatedness_network.py \
-M /path/to/matrix_output.txt \
-S /path/to/sample_individual... | 46.877551 | 2,571 | 0.681759 |
import pandas as pd
import numpy as np
import argparse
from graphviz import Graph
from colour import Color
import umap.umap_ as umap
import matplotlib.pyplot as plt
import matplotlib
'''
Creates visualization of sample relatedness (using LOD scores from CrosscheckFingerprints)
Samples with low coverage at fingerprin... | 0 | 0 | 0 | 0 | 0 | 3,291 | 0 | 13 | 385 |
fb8d1d47c9453dd8fb8795be9ad0b575298a3f43 | 737 | py | Python | app/oracle/scd41_collect_data.py | vinicentus/IoT-Microservice | 0632b920dc1a95e595bbdae792040f8dc6107072 | [
"MIT"
] | null | null | null | app/oracle/scd41_collect_data.py | vinicentus/IoT-Microservice | 0632b920dc1a95e595bbdae792040f8dc6107072 | [
"MIT"
] | null | null | null | app/oracle/scd41_collect_data.py | vinicentus/IoT-Microservice | 0632b920dc1a95e595bbdae792040f8dc6107072 | [
"MIT"
] | null | null | null | #!/home/pi/git-repos/IoT-Microservice/venv/bin/python3
# CHANGE PYTHON PATH TO MATCH YOUR LOCAL INSTALLATION
from datetime import datetime
from dbManager import add_entry_scd41, convertTimeStampToUTCString
from raspberry_pi_i2c_scd4x_python.i2c_class import I2C
from raspberry_pi_i2c_scd4x_python.sensor_class import SCD... | 30.708333 | 73 | 0.75848 | #!/home/pi/git-repos/IoT-Microservice/venv/bin/python3
# CHANGE PYTHON PATH TO MATCH YOUR LOCAL INSTALLATION
from datetime import datetime
from dbManager import add_entry_scd41, convertTimeStampToUTCString
from raspberry_pi_i2c_scd4x_python.i2c_class import I2C
from raspberry_pi_i2c_scd4x_python.sensor_class import SCD... | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5fac728024ce934ea2ac6dd54415a14f6cd01460 | 39,024 | py | Python | python_patient_exercise_program_V3/UI.py | iek21/python_patient_exercise_program | d81993a281a8aec0c31d90af16b92bf5076617f6 | [
"MIT"
] | null | null | null | python_patient_exercise_program_V3/UI.py | iek21/python_patient_exercise_program | d81993a281a8aec0c31d90af16b92bf5076617f6 | [
"MIT"
] | null | null | null | python_patient_exercise_program_V3/UI.py | iek21/python_patient_exercise_program | d81993a281a8aec0c31d90af16b92bf5076617f6 | [
"MIT"
] | null | null | null | ##library
from settings import Variables
from databse import data, return_data
v = Variables()
d = data()
rd = return_data()
| 44.547945 | 154 | 0.647089 | ##library
import tkinter as tk
from tkinter.ttk import *
from tkinter import *
from tkcalendar import DateEntry
import datetime
import time
from settings import Variables
import operation as op
from databse import data, return_data
v = Variables()
d = data()
rd = return_data()
def __init__():
... | 10 | 0 | 0 | 0 | 0 | 38,452 | 0 | -1 | 413 |
6b2a6be3bf26ff506f3b82641237eb42b033d54a | 2,722 | py | Python | tests/functional/test_regional_lead_flow.py | salmanulfarzy/wye | a52c15725f44688243c4b63ff7375553c7002d7b | [
"MIT"
] | 75 | 2015-08-27T04:16:17.000Z | 2022-01-05T13:59:46.000Z | tests/functional/test_regional_lead_flow.py | salmanulfarzy/wye | a52c15725f44688243c4b63ff7375553c7002d7b | [
"MIT"
] | 396 | 2015-09-13T04:50:58.000Z | 2022-03-11T23:25:50.000Z | tests/functional/test_regional_lead_flow.py | salmanulfarzy/wye | a52c15725f44688243c4b63ff7375553c7002d7b | [
"MIT"
] | 112 | 2015-08-30T12:58:50.000Z | 2021-01-31T17:02:31.000Z | from .. import factories as f
| 33.604938 | 69 | 0.695077 | import re
from .. import factories as f
def test_regional_lead_flow(base_url, browser, outbox):
f.create_usertype(slug='tutor', display_name='tutor')
section1 = f.create_workshop_section()
state = f.create_state()
location = f.create_locaiton()
user = f.create_user(is_staff=True)
user.set_pass... | 0 | 0 | 0 | 0 | 0 | 2,658 | 0 | -12 | 45 |
e5a3a58d2130853d27b969c4990b11a1d4833b97 | 5,382 | py | Python | django_editorjs_fields/templatetags/editorjs.py | pranav377/django-editorjs-fields | e32a4f5b7af3770df5580844eda04919f375d8f4 | [
"MIT"
] | null | null | null | django_editorjs_fields/templatetags/editorjs.py | pranav377/django-editorjs-fields | e32a4f5b7af3770df5580844eda04919f375d8f4 | [
"MIT"
] | null | null | null | django_editorjs_fields/templatetags/editorjs.py | pranav377/django-editorjs-fields | e32a4f5b7af3770df5580844eda04919f375d8f4 | [
"MIT"
] | null | null | null |
from django import template
register = template.Library()
| 28.17801 | 114 | 0.603122 | import json
from django import template
from django.utils.safestring import mark_safe
from django_editorjs_fields.config import IFRAME_ALLOWED_SITES_EXEC_JS
from urllib.parse import urlparse
register = template.Library()
def generate_paragraph(data):
text = data.get('text').replace(' ', ' ')
return f'<... | 0 | 1,439 | 0 | 0 | 0 | 3,408 | 0 | 75 | 387 |
45fe0aadd818cd1d2c13d0d9e3c1075cabd0e7c3 | 1,112 | py | Python | LinkedList/LinkedList.py | Karthiksaran-001/DataStructure | 07e74d33e2013b253760d5248a097df3642dc562 | [
"Apache-2.0"
] | null | null | null | LinkedList/LinkedList.py | Karthiksaran-001/DataStructure | 07e74d33e2013b253760d5248a097df3642dc562 | [
"Apache-2.0"
] | null | null | null | LinkedList/LinkedList.py | Karthiksaran-001/DataStructure | 07e74d33e2013b253760d5248a097df3642dc562 | [
"Apache-2.0"
] | null | null | null |
ll = LinkedList()
ll.insert_at_begining(10)
ll.insert_at_begining(20)
ll.insert_at_end(55)
ll.insert_at_begining(45)
ll.print() | 22.24 | 58 | 0.66277 | class Node:
def __init__(self, data=None, next_node=None):
self.data = data
self.next_node = next_node
class LinkedList:
def __init__(self):
self.head = None
## Method to display all elements inside the Linked List
def print(self):
if self.head is None:
print("Linked List is empty")
... | 0 | 0 | 0 | 938 | 0 | 0 | 0 | 0 | 45 |
b9384640658375a934b173dd4b8641e09b344e4e | 2,914 | py | Python | instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/__init__.py | shlee322/opentelemetry-python-contrib | 65801c31d8eba6c3625c29d610b67a97ed547a31 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/__init__.py | shlee322/opentelemetry-python-contrib | 65801c31d8eba6c3625c29d610b67a97ed547a31 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/__init__.py | shlee322/opentelemetry-python-contrib | 65801c31d8eba6c3625c29d610b67a97ed547a31 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # Copyright The OpenTelemetry 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 ... | 32.741573 | 77 | 0.703157 | # Copyright The OpenTelemetry 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 ... | 0 | 430 | 0 | 652 | 0 | 0 | 0 | 146 | 165 |
ac315c0ec972807e982622171fb7ae5c93fbb90c | 1,218 | py | Python | tests/integration/test_acquire.py | pauleveritt/kaybee | a00a718aaaa23b2d12db30dfacb6b2b6ec84459c | [
"Apache-2.0"
] | 2 | 2017-11-08T19:55:57.000Z | 2018-12-21T12:41:41.000Z | tests/integration/test_acquire.py | pauleveritt/kaybee | a00a718aaaa23b2d12db30dfacb6b2b6ec84459c | [
"Apache-2.0"
] | null | null | null | tests/integration/test_acquire.py | pauleveritt/kaybee | a00a718aaaa23b2d12db30dfacb6b2b6ec84459c | [
"Apache-2.0"
] | 1 | 2018-10-13T08:59:29.000Z | 2018-10-13T08:59:29.000Z | import pytest
pytestmark = pytest.mark.sphinx('html', testroot='acquire')
| 33.833333 | 75 | 0.633826 | import pytest
pytestmark = pytest.mark.sphinx('html', testroot='acquire')
@pytest.mark.parametrize('page', ['folder1/about.html', ], indirect=True)
class TestAcquire:
def test_about(self, page):
# First, make sure we are in the right place
h1 = page.find('h1').contents[0].strip()
assert ... | 0 | 1,095 | 0 | 0 | 0 | 0 | 0 | 0 | 46 |
2de5b0b6f52cc87ad3949a75a355fcb118d65830 | 134 | py | Python | gym_tic_tac_toe/__init__.py | MrScabbyCreature/gym-tic_tac_toe | 99c532a96131c6c3b6f80be36127614363deb176 | [
"MIT"
] | 2 | 2018-12-16T16:32:25.000Z | 2022-01-30T21:01:27.000Z | gym_tic_tac_toe/__init__.py | RobinChiu/gym-tic-tac-toe | a06eb012dc0b5b2a08206cea0acfa8e32c1f9a28 | [
"MIT"
] | null | null | null | gym_tic_tac_toe/__init__.py | RobinChiu/gym-tic-tac-toe | a06eb012dc0b5b2a08206cea0acfa8e32c1f9a28 | [
"MIT"
] | 1 | 2019-01-01T09:03:59.000Z | 2019-01-01T09:03:59.000Z | from gym.envs.registration import register
register(
id='tic_tac_toe-v0',
entry_point='gym_tic_tac_toe.envs:TicTacToeEnv',
)
| 19.142857 | 52 | 0.761194 | from gym.envs.registration import register
register(
id='tic_tac_toe-v0',
entry_point='gym_tic_tac_toe.envs:TicTacToeEnv',
)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1ff8fa13f96ae50e3e39a456a657765a4d501183 | 1,282 | py | Python | main.py | helloiamivan/blockchaindotcom-homework | 2db3f8f9b6b5279ec632be8784c86f866d667cc0 | [
"MIT"
] | null | null | null | main.py | helloiamivan/blockchaindotcom-homework | 2db3f8f9b6b5279ec632be8784c86f866d667cc0 | [
"MIT"
] | null | null | null | main.py | helloiamivan/blockchaindotcom-homework | 2db3f8f9b6b5279ec632be8784c86f866d667cc0 | [
"MIT"
] | null | null | null |
if __name__ == "__main__":
import schedule, time
schedule.every(1).minutes.do(saveJob)
print('Starting script to save exchange statistics...')
while True:
schedule.run_pending()
time.sleep(1)
| 26.163265 | 108 | 0.581903 | import requests, sys
from datetime import datetime
def getExchangeStatistics( symbol , exchange = 'blockchain' ):
URL = f'https://api.blockchain.com/v3/exchange/l2/{symbol}'
response = requests.get( URL, verify = True)
l2_data = response.json()
spread = ( l2_data['asks'][0]['px'] - l2_d... | 0 | 0 | 0 | 0 | 0 | 903 | 0 | 7 | 125 |
9d030ade95148e89a3b447d7dd1eaad23fb39776 | 545 | py | Python | Programa/negocio/documento.py | gabofer82/taller_programacion_2017 | f876a1711374b97824f06a216a14481f3d8b75f1 | [
"MIT"
] | null | null | null | Programa/negocio/documento.py | gabofer82/taller_programacion_2017 | f876a1711374b97824f06a216a14481f3d8b75f1 | [
"MIT"
] | null | null | null | Programa/negocio/documento.py | gabofer82/taller_programacion_2017 | f876a1711374b97824f06a216a14481f3d8b75f1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
| 23.695652 | 53 | 0.622018 | # -*- coding: utf-8 -*-
from persistencia.perdocumento import PerDocumento
class Documento(object):
def __init__(self, pk, tipo, numero, baja=False):
self.pk = pk
self.tipo = tipo
self.numero = numero
self.baja = baja
def salvar(self):
self.pk = PerDocumento().agregar_... | 0 | 0 | 0 | 446 | 0 | 0 | 0 | 29 | 45 |
2b033c001f71ba32ab597de038ca4f032917fb60 | 494 | py | Python | python/shipRoot_conf.py | Plamenna/proba | 517d7e437865c372e538f77d2242c188740f35d9 | [
"BSD-4-Clause"
] | null | null | null | python/shipRoot_conf.py | Plamenna/proba | 517d7e437865c372e538f77d2242c188740f35d9 | [
"BSD-4-Clause"
] | null | null | null | python/shipRoot_conf.py | Plamenna/proba | 517d7e437865c372e538f77d2242c188740f35d9 | [
"BSD-4-Clause"
] | null | null | null | import ROOT
#-----prepare python exit-----------------------------------------------
ROOT.gInterpreter.ProcessLine('typedef double Double32_t')
| 26 | 72 | 0.651822 | import ROOT, atexit, sys
#-----prepare python exit-----------------------------------------------
ROOT.gInterpreter.ProcessLine('typedef double Double32_t')
def pyExit():
x = sys.modules['__main__']
if hasattr(x,'run'): del x.run
if hasattr(x,'fMan'): del x.fMan
if hasattr(x,'fRun'): del x.fRun
pass
def configu... | 0 | 0 | 0 | 0 | 0 | 290 | 0 | 13 | 45 |
16b46c32cc9abcadd999479ca9bce01568fc7b81 | 615 | py | Python | documentation/examples/numpy_compatibility.py | arthus701/algopy | 1e2430f803289bbaed6bbdff6c28f98d7767835c | [
"Unlicense"
] | 54 | 2015-03-05T13:38:08.000Z | 2021-11-29T11:54:48.000Z | documentation/examples/numpy_compatibility.py | arthus701/algopy | 1e2430f803289bbaed6bbdff6c28f98d7767835c | [
"Unlicense"
] | 7 | 2016-04-06T11:25:00.000Z | 2020-11-09T13:53:20.000Z | documentation/examples/numpy_compatibility.py | arthus701/algopy | 1e2430f803289bbaed6bbdff6c28f98d7767835c | [
"Unlicense"
] | 13 | 2015-01-17T17:05:56.000Z | 2021-08-05T01:13:16.000Z | """
This example shows that most computations can be performed by numpy functions
on arrays of UTPM objects.
Just bear in mind that is much faster use UTPM instances of matrices than numpy.ndarrays
with UTPM elements.
"""
import numpy, os
from algopy import CGraph, Function, UTPM
N,D,P = 2,2,1
cg = CGraph()
x = num... | 25.625 | 88 | 0.728455 | """
This example shows that most computations can be performed by numpy functions
on arrays of UTPM objects.
Just bear in mind that is much faster use UTPM instances of matrices than numpy.ndarrays
with UTPM elements.
"""
import numpy, os
from algopy import CGraph, Function, UTPM, dot, qr, eigh, inv
N,D,P = 2,2,1
c... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 20 | 0 |
4909bbd4ab6618544ad96ff4e93be56a1f130081 | 103 | py | Python | notebooks/workflows/ocean_heat_content/solutions/solution_2_3.py | bonnland/ncar-python-tutorial | 54d536d40cfaf6f8990c58edb438286c19d32a67 | [
"CC-BY-4.0"
] | 38 | 2019-09-10T05:00:52.000Z | 2021-12-06T17:39:14.000Z | notebooks/workflows/ocean_heat_content/solutions/solution_2_3.py | bonnland/ncar-python-tutorial | 54d536d40cfaf6f8990c58edb438286c19d32a67 | [
"CC-BY-4.0"
] | 60 | 2019-08-28T22:34:17.000Z | 2021-01-25T22:53:21.000Z | notebooks/workflows/ocean_heat_content/solutions/solution_2_3.py | bonnland/ncar-python-tutorial | 54d536d40cfaf6f8990c58edb438286c19d32a67 | [
"CC-BY-4.0"
] | 22 | 2019-08-29T18:11:57.000Z | 2021-01-07T02:23:46.000Z | thetao_30lon_30lat = ds['thetao'].sel(lon=30, lat=30, method='nearest', tolerance=1)
thetao_30lon_30lat | 51.5 | 84 | 0.776699 | thetao_30lon_30lat = ds['thetao'].sel(lon=30, lat=30, method='nearest', tolerance=1)
thetao_30lon_30lat | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2add002c541e6b50164bd62a177ba3258b3c6d3c | 228 | py | Python | tests/FlaskTest/configs/custom_mask_rule.py | Laneglos/error-tracker | b07366e94199fc5157ddc5623fa12c8c0d07c483 | [
"BSD-3-Clause"
] | 16 | 2019-12-17T10:57:43.000Z | 2022-01-30T13:03:53.000Z | tests/FlaskTest/configs/custom_mask_rule.py | Laneglos/error-tracker | b07366e94199fc5157ddc5623fa12c8c0d07c483 | [
"BSD-3-Clause"
] | 15 | 2020-01-08T12:08:32.000Z | 2022-01-28T13:16:48.000Z | tests/FlaskTest/configs/custom_mask_rule.py | Laneglos/error-tracker | b07366e94199fc5157ddc5623fa12c8c0d07c483 | [
"BSD-3-Clause"
] | 8 | 2020-01-08T14:10:14.000Z | 2021-01-31T22:26:07.000Z | APP_ERROR_SEND_NOTIFICATION = True
APP_ERROR_RECIPIENT_EMAIL = None
APP_ERROR_SUBJECT_PREFIX = ""
APP_ERROR_MASK_WITH = "THIS_IS_MASK"
APP_ERROR_MASKED_KEY_HAS = ('key', 'password', 'secret')
APP_ERROR_URL_PREFIX = "/dev/error"
| 32.571429 | 56 | 0.807018 | APP_ERROR_SEND_NOTIFICATION = True
APP_ERROR_RECIPIENT_EMAIL = None
APP_ERROR_SUBJECT_PREFIX = ""
APP_ERROR_MASK_WITH = "THIS_IS_MASK"
APP_ERROR_MASKED_KEY_HAS = ('key', 'password', 'secret')
APP_ERROR_URL_PREFIX = "/dev/error"
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f71684275afc20018793ca67d49712a2693a0850 | 10,212 | py | Python | a3c_master_sewak.py | sebtac/MLxE | 93baa6b7c9fd14e54abd7199e868fb828e9a7c52 | [
"Apache-2.0"
] | 1 | 2020-12-15T17:19:33.000Z | 2020-12-15T17:19:33.000Z | a3c_master_sewak.py | sebtac/MLxE | 93baa6b7c9fd14e54abd7199e868fb828e9a7c52 | [
"Apache-2.0"
] | null | null | null | a3c_master_sewak.py | sebtac/MLxE | 93baa6b7c9fd14e54abd7199e868fb828e9a7c52 | [
"Apache-2.0"
] | null | null | null | """ A3C in Code - Centralized/ Gobal Network Parameter Server/ Controller
Based On:
A3C Code as in the book Deep Reinforcement Learning, Chapter 12.
Runtime: Python 3.6.5
Dependencies: numpy, matplotlib, tensorflow (/ tensorflow-gpu), gym
DocStrings: GoogleStyle
Author : Mohit Sewak (p20150023@goa-bits-pilani.a... | 39.890625 | 158 | 0.665785 | """ A3C in Code - Centralized/ Gobal Network Parameter Server/ Controller
Based On:
A3C Code as in the book Deep Reinforcement Learning, Chapter 12.
Runtime: Python 3.6.5
Dependencies: numpy, matplotlib, tensorflow (/ tensorflow-gpu), gym
DocStrings: GoogleStyle
Author : Mohit Sewak (p20150023@goa-bits-pilani.a... | 0 | 626 | 0 | 6,116 | 0 | 0 | 0 | 100 | 275 |
e0dc801ca922ea2c46bbb42286e5ce4cf738e811 | 1,551 | py | Python | src/mongo/db/fts/generate_stop_words.py | EshaMaharishi/pubsub-1 | 13cb194078ed39b00ea623db0d87df8e153e7981 | [
"Apache-2.0"
] | 29 | 2015-01-13T02:34:23.000Z | 2022-01-30T16:57:10.000Z | src/mongo/db/fts/generate_stop_words.py | wujf/mongo | f2f48b749ded0c5585c798c302f6162f19336670 | [
"Apache-2.0"
] | 2 | 2021-03-26T00:01:11.000Z | 2021-03-26T00:02:19.000Z | src/mongo/db/fts/generate_stop_words.py | wujf/mongo | f2f48b749ded0c5585c798c302f6162f19336670 | [
"Apache-2.0"
] | 23 | 2017-01-22T03:35:26.000Z | 2021-12-16T11:17:39.000Z | import sys
if __name__ == "__main__":
generate( sys.argv[ len(sys.argv) - 2],
sys.argv[ len(sys.argv) - 1],
sys.argv[1:-2] )
| 25.42623 | 84 | 0.521599 | import sys
def generate( header, source, language_files ):
print( "header: %s" % header )
print( "source: %s" % source )
print( "language_files:" )
for x in language_files:
print( "\t%s" % x )
out = open( header, "wb" )
out.write( """
#pragma once
#include <set>
#include <string>
#incl... | 0 | 0 | 0 | 0 | 0 | 1,369 | 0 | 0 | 23 |
c1a677c60aecb20e384e8da1a6833bf939dbfaf5 | 505 | py | Python | department/models.py | bewareoftheapp/fluxapp | b6b474e58a5fc0b18bd57e1da8089d5f6ae74d57 | [
"MIT"
] | null | null | null | department/models.py | bewareoftheapp/fluxapp | b6b474e58a5fc0b18bd57e1da8089d5f6ae74d57 | [
"MIT"
] | 15 | 2017-08-26T16:34:30.000Z | 2021-06-10T20:06:45.000Z | department/models.py | bewareoftheapp/fluxapp | b6b474e58a5fc0b18bd57e1da8089d5f6ae74d57 | [
"MIT"
] | null | null | null | '''Department models.'''
| 22.954545 | 56 | 0.718812 | '''Department models.'''
from django.contrib.auth.models import User as UserModel
from django.db import models
class Department(models.Model):
'''Represent a department.'''
name = models.CharField(max_length=128)
def __str__(self):
return str(self.name)
class UserDepartmentRelation(models.Mod... | 0 | 0 | 0 | 345 | 0 | 0 | 0 | 42 | 91 |
9870db7cb913c36a69693fc325b50c1cda400e07 | 8,709 | py | Python | examples_ltn/spatial_relations.py | gilbeckers/logictensornetworks | c4cc3628db91030230c78d3b964c26304a3b452b | [
"MIT"
] | null | null | null | examples_ltn/spatial_relations.py | gilbeckers/logictensornetworks | c4cc3628db91030230c78d3b964c26304a3b452b | [
"MIT"
] | null | null | null | examples_ltn/spatial_relations.py | gilbeckers/logictensornetworks | c4cc3628db91030230c78d3b964c26304a3b452b | [
"MIT"
] | 1 | 2019-05-19T01:28:04.000Z | 2019-05-19T01:28:04.000Z | import tensorflow as tf
import logictensornetworks as ltn
import numpy as np
from logictensornetworks import Forall, Implies, And, Not
import matplotlib.pyplot as plt
import matplotlib.patches as patches
# generate artificial data
nr_of_bb = 4000
# minimal and maximal position and dimension of rectangles
min_xywh =... | 33.367816 | 125 | 0.657825 | import tensorflow as tf
import logictensornetworks as ltn
import numpy as np
from logictensornetworks import Forall,Exists, Equiv, Implies, And, Or, Not
import matplotlib.pyplot as plt
import matplotlib.patches as patches
# generate artificial data
nr_of_bb = 4000
# minimal and maximal position and dimension of rec... | 0 | 0 | 0 | 0 | 0 | 1,849 | 0 | 18 | 321 |
26dd18b118b7c0e07990efbe43d18d0a6fa3edf9 | 4,853 | py | Python | notebooks/thesis_functions/visualization.py | aerosara/thesis | 55bd84e8d4b4bffa8f7526bd5b94ddef80911f99 | [
"MIT"
] | null | null | null | notebooks/thesis_functions/visualization.py | aerosara/thesis | 55bd84e8d4b4bffa8f7526bd5b94ddef80911f99 | [
"MIT"
] | null | null | null | notebooks/thesis_functions/visualization.py | aerosara/thesis | 55bd84e8d4b4bffa8f7526bd5b94ddef80911f99 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <codecell>
from matplotlib import rcParams
# font size
rcParams['axes.labelsize'] = 12
rcParams['xtick.labelsize'] = 12
rcParams['ytick.labelsize'] = 12
rcParams['legend.fontsize'] = 12
# typeface
rcParams['font.family'] = 'serif'
rcParams['font.serif'] = ['Compu... | 33.937063 | 162 | 0.64558 | # -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <codecell>
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import rcParams
from mpl_toolkits.mplot3d import Axes3D
# font size
rcParams['axes.labelsize'] = 12
rcParams['xtick.labelsize'] = 12
rcParams['ytick.labelsize'] = 12
rcParams['legend.fo... | 0 | 0 | 0 | 0 | 0 | 4,303 | 0 | 25 | 148 |
bf9f730e1574500ce75a38ad2c589b79d24b61ea | 5,186 | py | Python | smipyping/_previousscanstable.py | KSchopmeyer/smipyping | 9c60b3489f02592bd9099b8719ca23ae43a9eaa5 | [
"MIT"
] | null | null | null | smipyping/_previousscanstable.py | KSchopmeyer/smipyping | 9c60b3489f02592bd9099b8719ca23ae43a9eaa5 | [
"MIT"
] | 19 | 2017-10-18T15:31:25.000Z | 2020-03-04T19:31:59.000Z | smipyping/_previousscanstable.py | KSchopmeyer/smipyping | 9c60b3489f02592bd9099b8719ca23ae43a9eaa5 | [
"MIT"
] | null | null | null | # (C) Copyright 2017 Inova Development Inc.
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | 34.805369 | 79 | 0.619553 | # (C) Copyright 2017 Inova Development Inc.
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | 0 | 713 | 0 | 3,351 | 0 | 0 | 0 | 11 | 181 |
dbed4e0820b1ef30c6cd1ba45839aaf53af7c28e | 21,190 | py | Python | pymote2.1/pymote/gui/simulationgui.py | chinmaydd/RouteSense | a2088d0151be7c76d269d2c5466750423fbe9e02 | [
"MIT"
] | 17 | 2015-09-15T11:07:27.000Z | 2022-03-21T23:27:27.000Z | pymote2.1/pymote/gui/simulationgui.py | chinmaydd/RouteSense | a2088d0151be7c76d269d2c5466750423fbe9e02 | [
"MIT"
] | 1 | 2019-04-13T11:09:05.000Z | 2019-04-13T11:09:05.000Z | pymote2.1/pymote/gui/simulationgui.py | chinmaydd/RouteSense | a2088d0151be7c76d269d2c5466750423fbe9e02 | [
"MIT"
] | 13 | 2016-03-26T01:29:17.000Z | 2022-03-17T02:32:00.000Z | import sys
import os # @Reimport
from PySide.QtGui import QMessageBox
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg \
as FigureCanvas
from matplotlib.backends.backend_qt4agg import NavigationToolbar2QTAgg \
as Na... | 40.98646 | 94 | 0.549599 | from pymote import * # @UnusedWildImport
import sys
import os # @Reimport
import numpy
from PySide.QtGui import QMainWindow, QMenu, QCursor, QFileDialog, QMessageBox
from PySide.QtCore import SIGNAL, QRect, QSize, QEvent
from matplotlib.figure import Figure
from matplotlib.patches import Circle
from matplotlib.backen... | 0 | 0 | 0 | 19,207 | 0 | 50 | 0 | 341 | 443 |
1f4c8123391bf75590da0f0af867e9bddcd5dcf3 | 4,556 | py | Python | snuba/datasets/entities/transactions.py | fpacifici/snuba | cf732b71383c948f9387fbe64e9404ca71f8e9c5 | [
"Apache-2.0"
] | null | null | null | snuba/datasets/entities/transactions.py | fpacifici/snuba | cf732b71383c948f9387fbe64e9404ca71f8e9c5 | [
"Apache-2.0"
] | null | null | null | snuba/datasets/entities/transactions.py | fpacifici/snuba | cf732b71383c948f9387fbe64e9404ca71f8e9c5 | [
"Apache-2.0"
] | null | null | null |
from snuba.clickhouse.translators.snuba.mappers import (ColumnToFunction, ColumnToLiteral, ColumnToMapping, ColumnToColumn, SubscriptableMapper)
from snuba.clickhouse.translators.snuba.mapping import TranslationMappers
from snuba.query.expressions import Column, FunctionCall, Literal
transaction_translator = Translat... | 40.318584 | 88 | 0.667252 | from abc import ABC
from datetime import timedelta
from typing import Mapping, Optional, Sequence
from snuba.clickhouse.translators.snuba.mappers import (
ColumnToFunction,
ColumnToLiteral,
ColumnToMapping,
ColumnToColumn,
SubscriptableMapper,
)
from snuba.clickhouse.translators.snuba.mapping impor... | 0 | 0 | 0 | 1,457 | 0 | 0 | 0 | 580 | 376 |
76b050b086d05fd8e9f3a5af7ac641bac2cada6d | 1,186 | py | Python | tests/__init__.py | 05bit/python-signa | 825767a6d6970d357b627de4c5b5e88a14dc0e75 | [
"MIT"
] | 1 | 2017-06-04T10:26:30.000Z | 2017-06-04T10:26:30.000Z | tests/__init__.py | 05bit/python-signa | 825767a6d6970d357b627de4c5b5e88a14dc0e75 | [
"MIT"
] | null | null | null | tests/__init__.py | 05bit/python-signa | 825767a6d6970d357b627de4c5b5e88a14dc0e75 | [
"MIT"
] | null | null | null | import os
# import time
from dotenv import load_dotenv, find_dotenv
load_dotenv(find_dotenv())
aws_region = os.environ.get('AWS_DEFAULT_REGION', 'us-east-1')
aws_access_key = os.environ.get('AWS_ACCESS_KEY_ID')
aws_secret_key = os.environ.get('AWS_SECRET_ACCESS_KEY')
aws_s3_provider = os.environ.get('AWS_S3_PROVIDER'... | 27.581395 | 62 | 0.625632 | import os
# import time
import unittest
from dotenv import load_dotenv, find_dotenv
import signa
load_dotenv(find_dotenv())
aws_region = os.environ.get('AWS_DEFAULT_REGION', 'us-east-1')
aws_access_key = os.environ.get('AWS_ACCESS_KEY_ID')
aws_secret_key = os.environ.get('AWS_SECRET_ACCESS_KEY')
aws_s3_provider = os.... | 0 | 0 | 0 | 645 | 0 | 0 | 0 | -15 | 67 |
9b0ecb2f0378668af2892285cf82b3bb4b926a62 | 3,496 | py | Python | serieswatcher/serieswatcher/tasks/downloadserie.py | lightcode/SeriesWatcher | df3e04227822eda4cb3130a63d4b4649e50bea25 | [
"MIT"
] | null | null | null | serieswatcher/serieswatcher/tasks/downloadserie.py | lightcode/SeriesWatcher | df3e04227822eda4cb3130a63d4b4649e50bea25 | [
"MIT"
] | null | null | null | serieswatcher/serieswatcher/tasks/downloadserie.py | lightcode/SeriesWatcher | df3e04227822eda4cb3130a63d4b4649e50bea25 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
| 36.041237 | 75 | 0.564073 | # -*- coding: utf-8 -*-
import os.path
from datetime import datetime
from PyQt4 import QtCore
from PyQt4.QtCore import qDebug
from sqlobject.sqlbuilder import AND
from serieswatcher.const import *
from serieswatcher.models import Serie, Episode
from serieswatcher.thetvdb import TheTVDBSerie
class DownloadSerieTask(Q... | 0 | 0 | 0 | 3,179 | 0 | 0 | 0 | 92 | 200 |
275bf4243657b3526879fea8c465ee3037f4cdf7 | 1,201 | py | Python | firmware/python/peri.py | ploychananya/hand-in-head_voiceregcognite | f4077835cfafa13d4091eafa82fdb33fa34176c4 | [
"CC-BY-3.0"
] | null | null | null | firmware/python/peri.py | ploychananya/hand-in-head_voiceregcognite | f4077835cfafa13d4091eafa82fdb33fa34176c4 | [
"CC-BY-3.0"
] | null | null | null | firmware/python/peri.py | ploychananya/hand-in-head_voiceregcognite | f4077835cfafa13d4091eafa82fdb33fa34176c4 | [
"CC-BY-3.0"
] | null | null | null |
####################################
| 30.794872 | 78 | 0.512073 | from practicum import McuBoard,find_mcu_boards
####################################
class McuWithPeriBoard(McuBoard):
################################
def setLed(self, led_no, led_val):
'''
Set status of LED led_no on peripheral board to led_val
'''
self.usb_write(request=0,ind... | 0 | 0 | 0 | 1,094 | 0 | 0 | 0 | 25 | 44 |
f71a2cf03b51c5cbf16bd9aeb093968dd349cef9 | 7,353 | py | Python | take_images.py | ManuLado/Enviar-comandos-a-marlin | f7f474ad0459602176114c62e7c97874cb69191b | [
"MIT"
] | 2 | 2021-10-02T20:20:45.000Z | 2021-10-02T20:20:53.000Z | take_images.py | ManuLado/2D-XRay_Scan_control | 5ba596c9b0db47125e2e29ed8084e61d326e8777 | [
"MIT"
] | null | null | null | take_images.py | ManuLado/2D-XRay_Scan_control | 5ba596c9b0db47125e2e29ed8084e61d326e8777 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Graba video leido desde la arducam
# Se le debe indicar el archivo de video a grabar y
# la duracin de la captura en segundos.
# SINTAXIS: python capturar_video.py VIDEO TIEMPO
# 1- Ruta del video
# 2- Tiempo de grabacion en segundos
import sys
import time
import t... | 28.610895 | 134 | 0.622195 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Graba video leido desde la arducam
# Se le debe indicar el archivo de video a grabar y
# la duración de la captura en segundos.
# SINTAXIS: python capturar_video.py VIDEO TIEMPO
# 1- Ruta del video
# 2- Tiempo de grabacion en segundos
from ctypes import *
import ct... | 6 | 0 | 0 | 0 | 0 | 3,230 | 0 | -17 | 314 |
7daec05755ee01f3d8831aaae4ce3f3eaa1124cf | 2,268 | py | Python | compliance/test_server.py | bluetech/wsproto | 00bc6b21c623ce13476e9ec0a763c16e9f7cca4e | [
"MIT"
] | null | null | null | compliance/test_server.py | bluetech/wsproto | 00bc6b21c623ce13476e9ec0a763c16e9f7cca4e | [
"MIT"
] | null | null | null | compliance/test_server.py | bluetech/wsproto | 00bc6b21c623ce13476e9ec0a763c16e9f7cca4e | [
"MIT"
] | null | null | null |
count = 0
if __name__ == '__main__':
try:
start_listener()
except KeyboardInterrupt:
pass
| 30.24 | 107 | 0.619929 | import select
import socket
from wsproto import WSConnection
from wsproto.connection import ConnectionState, SERVER
from wsproto.events import AcceptConnection, CloseConnection, Message, Ping, Request
from wsproto.extensions import PerMessageDeflate
count = 0
def new_conn(sock):
global count
print("test_serv... | 0 | 0 | 0 | 0 | 0 | 1,855 | 0 | 118 | 179 |
3587ed91b8e3733ea5f03f3f488b42905a22724d | 22,236 | py | Python | private_sharing/views.py | fanly/open-humans | ec5b8fd0bfb1d80504208ec0c4a876341f54fc67 | [
"MIT"
] | null | null | null | private_sharing/views.py | fanly/open-humans | ec5b8fd0bfb1d80504208ec0c4a876341f54fc67 | [
"MIT"
] | null | null | null | private_sharing/views.py | fanly/open-humans | ec5b8fd0bfb1d80504208ec0c4a876341f54fc67 | [
"MIT"
] | null | null | null | from django.conf import settings
# TODO: move this to common
MAX_UNAPPROVED_MEMBERS = settings.MAX_UNAPPROVED_MEMBERS
| 30.460274 | 97 | 0.646024 | from django.conf import settings
from django.contrib import messages as django_messages
from django.core.exceptions import ObjectDoesNotExist
from django.http import Http404, HttpResponseRedirect
from django.urls import reverse, reverse_lazy
from django.views.generic import (
CreateView,
DetailView,
FormVie... | 0 | 429 | 0 | 20,177 | 0 | 0 | 0 | 641 | 842 |
5dc5c8a508f2f89b37a01b8f0488d2ae87dd4ed3 | 37,206 | py | Python | my_utils/parsers.py | Minys233/GCN-BMP | 21b64a3c8cc9bc33718ae09c65aa917e575132eb | [
"MIT"
] | null | null | null | my_utils/parsers.py | Minys233/GCN-BMP | 21b64a3c8cc9bc33718ae09c65aa917e575132eb | [
"MIT"
] | null | null | null | my_utils/parsers.py | Minys233/GCN-BMP | 21b64a3c8cc9bc33718ae09c65aa917e575132eb | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 12/8/2018 9:00 PM
# @Author : chinshin
# @FileName: parsers.py
| 44.398568 | 145 | 0.548218 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 12/8/2018 9:00 PM
# @Author : chinshin
# @FileName: parsers.py
import os
from logging import getLogger
import numpy
import pandas
import pickle
from rdkit import Chem
from tqdm import tqdm
from chainer_chemistry.dataset.parsers.base_parser impo... | 0 | 0 | 0 | 36,475 | 0 | 0 | 0 | 199 | 398 |
86a1286da332d210e04db8a6d464082e2c824806 | 7,173 | py | Python | allauth/socialaccount/helpers.py | Raekkeri/django-allauth | a66dad7a4c2583c7d46c3eb0e8d3c7654ea5706c | [
"MIT"
] | null | null | null | allauth/socialaccount/helpers.py | Raekkeri/django-allauth | a66dad7a4c2583c7d46c3eb0e8d3c7654ea5706c | [
"MIT"
] | null | null | null | allauth/socialaccount/helpers.py | Raekkeri/django-allauth | a66dad7a4c2583c7d46c3eb0e8d3c7654ea5706c | [
"MIT"
] | null | null | null | from django.template.defaultfilters import slugify
def _name_from_url(url):
"""
>>> _name_from_url('http://google.com/dir/file.ext')
u'file.ext'
>>> _name_from_url('http://google.com/dir/')
u'dir'
>>> _name_from_url('http://google.com/dir')
u'dir'
>>> _name_from_url('http://google.c... | 39.196721 | 76 | 0.621637 | from django.contrib import messages
from django.shortcuts import render_to_response
from django.http import HttpResponseRedirect
from django.template import RequestContext
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
fro... | 0 | 0 | 0 | 0 | 0 | 5,453 | 0 | 327 | 448 |
6304a48806e98a8148638ad344281d6a72bf58ed | 8,790 | py | Python | cliapp/runcmd.py | lawer/fog_client_linux | 90a7d95a1822a296a54a4691cda1f400dd63fcdc | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | cliapp/runcmd.py | lawer/fog_client_linux | 90a7d95a1822a296a54a4691cda1f400dd63fcdc | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | cliapp/runcmd.py | lawer/fog_client_linux | 90a7d95a1822a296a54a4691cda1f400dd63fcdc | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | # Copyright (C) 2011, 2012 Lars Wirzenius
# Copyright (C) 2012 Codethink Limited
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any la... | 30.842105 | 75 | 0.580432 | # Copyright (C) 2011, 2012 Lars Wirzenius
# Copyright (C) 2012 Codethink Limited
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any la... | 0 | 0 | 0 | 0 | 0 | 3,567 | 0 | 0 | 73 |
f11ac1a84bfe4896564789170575e0dd19eecd1b | 902 | py | Python | teoria_dos_grafos/algoritmos/Matrix.py | WesleyAdriann/iesb | 99c856f12df5d9c35003ce2e28242077f07eeae5 | [
"MIT"
] | null | null | null | teoria_dos_grafos/algoritmos/Matrix.py | WesleyAdriann/iesb | 99c856f12df5d9c35003ce2e28242077f07eeae5 | [
"MIT"
] | null | null | null | teoria_dos_grafos/algoritmos/Matrix.py | WesleyAdriann/iesb | 99c856f12df5d9c35003ce2e28242077f07eeae5 | [
"MIT"
] | 1 | 2020-04-21T01:17:45.000Z | 2020-04-21T01:17:45.000Z |
# -*- coding: utf-8 -*-
| 26.529412 | 64 | 0.486696 |
# -*- coding: utf-8 -*-
class Digraph():
def __init__(self, v):
self.matrix = [[-1 for i in range(v)] for i in range(v)]
def __str__(self):
for i in range(len(self.matrix)):
for j in range(len(self.matrix)):
print("{} ".format(matrix[i][j]), end='')
pri... | 0 | 0 | 0 | 829 | 0 | 0 | 0 | 0 | 46 |
b330f3b257edfe2aa8e77c6d40db27d05082b8f5 | 517 | py | Python | Meus Projetos/jogando dados.py | lucas0395/Meus-Projetos-em-Python | f48f3f00a525fcf2c8634672a87b3e5cc440c59d | [
"MIT"
] | 1 | 2022-03-18T01:16:40.000Z | 2022-03-18T01:16:40.000Z | Meus Projetos/jogando dados.py | lucas0395/Meus-Projetos-em-Python | f48f3f00a525fcf2c8634672a87b3e5cc440c59d | [
"MIT"
] | null | null | null | Meus Projetos/jogando dados.py | lucas0395/Meus-Projetos-em-Python | f48f3f00a525fcf2c8634672a87b3e5cc440c59d | [
"MIT"
] | null | null | null | import tkinter
root = tkinter.Tk()
root.geometry('300x300')
root.title('Jogar Dado')
# display do dado
label = tkinter.Label(root, text='', font=('Arial', 260))
# funo ativada por boto
# boto
botao = tkinter.Button(root, text='Jogar Dado', foreground='black', command=jogar_dados)
botao.pack()
# mantem a janela ab... | 22.478261 | 88 | 0.678917 | import tkinter
import random
root = tkinter.Tk()
root.geometry('300x300')
root.title('Jogar Dado')
# display do dado
label = tkinter.Label(root, text='', font=('Arial', 260))
# função ativada por botão
def jogar_dados():
dado = ['\u2680', '\u2681', '\u2682', '\u2683', '\u2684', '\u2685']
label.configure(text... | 8 | 0 | 0 | 0 | 0 | 137 | 0 | -8 | 44 |
d28a84403a999427e91cba861631f53ff746ef89 | 2,903 | py | Python | bfiao/bfiao.py | msicilia/bfiao | 61febf1552b08d353d8fbeae0d450e98200d1b93 | [
"MIT"
] | null | null | null | bfiao/bfiao.py | msicilia/bfiao | 61febf1552b08d353d8fbeae0d450e98200d1b93 | [
"MIT"
] | null | null | null | bfiao/bfiao.py | msicilia/bfiao | 61febf1552b08d353d8fbeae0d450e98200d1b93 | [
"MIT"
] | null | null | null |
# Locations of used ontologies and serialization format transforms.
bfo_url = "http://purl.obolibrary.org/obo/bfo.owl"
cco_url = "https://raw.githubusercontent.com/CommonCoreOntology/CommonCoreOntologies/master/cco-merged/MergedAllCoreOntology_v1.3.ttl"
cco_location = "cco.nt"
turtle_to_nt(cco_location, cco_location... | 36.2875 | 134 | 0.728557 | from owlready2 import *
from util import *
# Locations of used ontologies and serialization format transforms.
bfo_url = "http://purl.obolibrary.org/obo/bfo.owl"
cco_url = "https://raw.githubusercontent.com/CommonCoreOntology/CommonCoreOntologies/master/cco-merged/MergedAllCoreOntology_v1.3.ttl"
cco_location = "cco.... | 0 | 0 | 0 | 1,415 | 0 | 0 | 0 | -1 | 183 |
93d152972e41f3664a1c552eadb05e7fecfc98b9 | 3,335 | py | Python | PyPoll/main.py | mitchellcapell95/Python-Challenge-1 | 661a1bde27a27a238401800a729286379018da11 | [
"ADSL"
] | null | null | null | PyPoll/main.py | mitchellcapell95/Python-Challenge-1 | 661a1bde27a27a238401800a729286379018da11 | [
"ADSL"
] | null | null | null | PyPoll/main.py | mitchellcapell95/Python-Challenge-1 | 661a1bde27a27a238401800a729286379018da11 | [
"ADSL"
] | null | null | null |
import csv
# csvpath = os.path.join('Desktop','UCFLM201907DATA2','03-Python', 'Homework','Instructions','PyPoll','Resources','election_data.csv')
csvpath = "election_data.csv"
counter = 0
candidate_Khan = 0
candidate_Correy = 0
candidate_Li = 0
candidate_Tooley = 0
list_of_candidates = []
with op... | 34.381443 | 135 | 0.629385 | import os
import csv
# csvpath = os.path.join('Desktop','UCFLM201907DATA2','03-Python', 'Homework','Instructions','PyPoll','Resources','election_data.csv')
csvpath = "election_data.csv"
counter = 0
candidate_Khan = 0
candidate_Correy = 0
candidate_Li = 0
candidate_Tooley = 0
list_of_candidates = []... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -12 | 23 |
8714278416833dd81a746a0c94195bb9eab22098 | 1,949 | py | Python | Rec_Server/utils/load_item_data.py | mishidemudong/deep_recommendation | 6100cfd4037b45b167227ed76acbc536500bc119 | [
"Apache-2.0"
] | null | null | null | Rec_Server/utils/load_item_data.py | mishidemudong/deep_recommendation | 6100cfd4037b45b167227ed76acbc536500bc119 | [
"Apache-2.0"
] | null | null | null | Rec_Server/utils/load_item_data.py | mishidemudong/deep_recommendation | 6100cfd4037b45b167227ed76acbc536500bc119 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri May 14 10:57:42 2021
@author: liang
"""
if __name__ == "__main__":
import redis
pool = redis.ConnectionPool(host='localhost', port=6379, decode_responses=True)
redis_curse = redis.Redis(connection_pool=pool)
sample... | 28.661765 | 317 | 0.604413 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri May 14 10:57:42 2021
@author: liang
"""
import pandas as pd
import requests
def get_data_redis(curse_redis, id_list, id_name):
#####get data from redis
dta = curse_redis.mget(id_list)
# columns_list = list(eval(dta[0]).keys())
col... | 15 | 0 | 0 | 0 | 0 | 1,110 | 0 | -8 | 91 |
475944f25da1e44db067870e1234c144c4314615 | 8,924 | py | Python | can_tools/scrapers/official/FL/fl_vaccine.py | christopherturner/can-scrapers | e580e6bc507ffd5fae06e43bb285822e3cd43986 | [
"MIT"
] | 7 | 2020-11-11T14:47:46.000Z | 2021-12-28T02:21:41.000Z | can_tools/scrapers/official/FL/fl_vaccine.py | christopherturner/can-scrapers | e580e6bc507ffd5fae06e43bb285822e3cd43986 | [
"MIT"
] | 176 | 2020-11-13T00:32:44.000Z | 2022-02-17T01:32:30.000Z | can_tools/scrapers/official/FL/fl_vaccine.py | christopherturner/can-scrapers | e580e6bc507ffd5fae06e43bb285822e3cd43986 | [
"MIT"
] | 13 | 2020-11-14T19:25:34.000Z | 2021-04-04T22:32:07.000Z | import pandas as pd
| 35.553785 | 117 | 0.56645 | import re
import tempfile
import pandas as pd
import camelot
import pandas as pd
import requests
import us
import textract
from can_tools.scrapers.official.base import StateDashboard
from can_tools.scrapers import variables, CMU
from typing import Any, Dict
class FloridaCountyVaccine(StateDashboard):
has_locatio... | 0 | 0 | 0 | 8,617 | 0 | 0 | 0 | 18 | 267 |
334911623b65e69ba0a64d31ff4c72a85d533468 | 1,504 | py | Python | jotify/jotify/textui.py | velezj/jotify | fe50f65ad9973d15aaaffe683d808efc0ec76abf | [
"MIT"
] | null | null | null | jotify/jotify/textui.py | velezj/jotify | fe50f65ad9973d15aaaffe683d808efc0ec76abf | [
"MIT"
] | null | null | null | jotify/jotify/textui.py | velezj/jotify | fe50f65ad9973d15aaaffe683d808efc0ec76abf | [
"MIT"
] | null | null | null |
from .state_ui import UI
import blessings
## ========================================================================
## ========================================================================
## ========================================================================
if __name__ == "__main__":
... | 30.08 | 75 | 0.388963 | import datetime
import logging
from .state_ui import UI, State
import dateutil.parser
import blessings
## ========================================================================
def _log():
return logging.getLogger( __name__ )
## ========================================================================
def _s... | 0 | 0 | 0 | 0 | 0 | 949 | 0 | -5 | 113 |
e9ab57aee38b471de11b1cf7d7daacc3a2254302 | 2,934 | py | Python | evology/bin/testing_&_archiv/temp_solver.py | aymericvie/evology | 8f00d94dee7208be5a5bdd0375a9d6ced25097f4 | [
"Apache-2.0"
] | null | null | null | evology/bin/testing_&_archiv/temp_solver.py | aymericvie/evology | 8f00d94dee7208be5a5bdd0375a9d6ced25097f4 | [
"Apache-2.0"
] | 2 | 2022-01-10T02:10:56.000Z | 2022-01-14T03:41:42.000Z | evology/bin/testing_&_archiv/temp_solver.py | aymericvie/evology | 8f00d94dee7208be5a5bdd0375a9d6ced25097f4 | [
"Apache-2.0"
] | null | null | null |
"""
Here is a simple optimisation solver for the market clearing algorithm.
We minimise the squared of aggregate excess demand, under the constraint of
a Limit-Up-Limit-Down (LU-LD) circuit breaker, which limits prices to
[LD*p(t-1), LU*p(t-1)], with LD=1/2 and LU = 2
The solver uses the LEAP package: https://gith... | 29.636364 | 84 | 0.706203 | import numpy as np
"""
Here is a simple optimisation solver for the market clearing algorithm.
We minimise the squared of aggregate excess demand, under the constraint of
a Limit-Up-Limit-Down (LU-LD) circuit breaker, which limits prices to
[LD*p(t-1), LU*p(t-1)], with LD=1/2 and LU = 2
The solver uses the LEAP pa... | 0 | 0 | 0 | 0 | 0 | 1,134 | 0 | 130 | 201 |
1548ad609e4717007ab0a7e895012d3db0135811 | 11,851 | py | Python | train_dec.py | eitanrich/stylegan2-pytorch | a4ac1049372aac9f46c09691000550d76867d634 | [
"MIT",
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | train_dec.py | eitanrich/stylegan2-pytorch | a4ac1049372aac9f46c09691000550d76867d634 | [
"MIT",
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | train_dec.py | eitanrich/stylegan2-pytorch | a4ac1049372aac9f46c09691000550d76867d634 | [
"MIT",
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | import argparse
import os
import torch
from torch import nn, optim
from torch.utils import data
from torchvision import transforms
# try:
# import wandb
#
# except ImportError:
# wandb = None
from model import Generator, Code2Style
from dataset import MultiResolutionDataset
from distributed import (synchroniz... | 28.351675 | 107 | 0.604759 | import argparse
import math
import random
import os
import numpy as np
import torch
from torch import nn, autograd, optim
from torch.nn import functional as F
from torch.utils import data
import torch.distributed as dist
from torchvision import transforms, utils
from tqdm import tqdm
# try:
# import wandb
#
# exc... | 0 | 0 | 0 | 0 | 72 | 3,657 | 0 | 111 | 431 |
70b2b7be805885168ffc7f2e57052379c4e18c28 | 4,434 | py | Python | satchless/product/tests/product.py | bartels/satchless | 4d333014333dc4fd5815f9e0bbea565959919a30 | [
"BSD-4-Clause"
] | 1 | 2015-11-05T10:26:46.000Z | 2015-11-05T10:26:46.000Z | satchless/product/tests/product.py | bartels/satchless | 4d333014333dc4fd5815f9e0bbea565959919a30 | [
"BSD-4-Clause"
] | null | null | null | satchless/product/tests/product.py | bartels/satchless | 4d333014333dc4fd5815f9e0bbea565959919a30 | [
"BSD-4-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#from django.db import connection, reset_queries
__all__ = ['Models', 'Registry', 'Views', 'product_app']
product_app = TestProductApp()
| 37.260504 | 81 | 0.645241 | # -*- coding: utf-8 -*-
import decimal
import os
from django.conf import settings
from django.conf.urls.defaults import patterns, include, url
from django.core.urlresolvers import reverse
#from django.db import connection, reset_queries
from django.test import TestCase, Client
from ...util.tests import ViewsTestCase
... | 0 | 0 | 0 | 3,681 | 0 | 0 | 0 | 247 | 338 |
8b618f513aa7c095b0d072ba8faeaecf43c11585 | 7,489 | py | Python | sim_motor.py | bopopescu/Lauecollect | 60ae2b05ea8596ba0decf426e37aeaca0bc8b6be | [
"MIT"
] | null | null | null | sim_motor.py | bopopescu/Lauecollect | 60ae2b05ea8596ba0decf426e37aeaca0bc8b6be | [
"MIT"
] | 1 | 2019-10-22T21:28:31.000Z | 2019-10-22T21:39:12.000Z | sim_motor.py | bopopescu/Lauecollect | 60ae2b05ea8596ba0decf426e37aeaca0bc8b6be | [
"MIT"
] | 2 | 2019-06-06T15:06:46.000Z | 2020-07-20T02:03:22.000Z | """Software simulated motor
Author: Friedrich Schotte
Date created: 2015-11-03
Date last modified: 2019-05-26
"""
__version__ = "1.2" # sim_EPICS_motor: readback
if __name__ == "__main__":
import logging
logging.basicConfig(level=logging.DEBUG,format="%(asctime): %(message)s")
motor = sim_EPICS_motor
... | 37.074257 | 89 | 0.670717 | """Software simulated motor
Author: Friedrich Schotte
Date created: 2015-11-03
Date last modified: 2019-05-26
"""
__version__ = "1.2" # sim_EPICS_motor: readback
class sim_motor(object):
from persistent_property import persistent_property
from numpy import inf
stepsize = persistent_property("stepsize",0.00... | 0 | 0 | 0 | 6,623 | 0 | 0 | 0 | 5 | 72 |
5ee4194a5f4e2c4f36d4764b00d274c54ccc31dc | 418 | py | Python | initial.py | Pure-Peace/New-ot-socketio | c3124aed6941ecf885f8c16522bcc64a3b4b488c | [
"MIT"
] | 1 | 2022-02-15T08:01:10.000Z | 2022-02-15T08:01:10.000Z | initial.py | Pure-Peace/New-ot-socketio | c3124aed6941ecf885f8c16522bcc64a3b4b488c | [
"MIT"
] | null | null | null | initial.py | Pure-Peace/New-ot-socketio | c3124aed6941ecf885f8c16522bcc64a3b4b488c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
'''
otsu.fun - Website Api Initial
@version: 0.9
@author: PurePeace
@time: 2019-12-10
@describe: initial some config.
'''
from flask import Flask
from flask_cors import CORS
# initial(s)
app = Flask('engine')
app.config.update(RESTFUL_JSON=dict(ensure_ascii=False))
CORS(ap... | 16.076923 | 57 | 0.643541 | # -*- coding: utf-8 -*-
'''
otsu.fun - Website Api Initial
@version: 0.9
@author: PurePeace
@time: 2019-12-10
@describe: initial some config.
'''
from flask import Flask
from flask_cors import CORS
# initial(s)
app = Flask('engine')
app.config.update(RESTFUL_JSON=dict(ensure_ascii=False))
CORS(ap... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
af3ac1b0f91c03edb5407b34d927aa6fa768ed32 | 6,640 | py | Python | scripts/paso_6_calcular_compatibilidades_con_clusters_por_posicion.py | edconde/tfm-visualanalytics-bigdata | 903b56b2eb38d61aab2d754a22c28223d96e28eb | [
"MIT"
] | null | null | null | scripts/paso_6_calcular_compatibilidades_con_clusters_por_posicion.py | edconde/tfm-visualanalytics-bigdata | 903b56b2eb38d61aab2d754a22c28223d96e28eb | [
"MIT"
] | null | null | null | scripts/paso_6_calcular_compatibilidades_con_clusters_por_posicion.py | edconde/tfm-visualanalytics-bigdata | 903b56b2eb38d61aab2d754a22c28223d96e28eb | [
"MIT"
] | null | null | null | from pymongo import MongoClient
import time
start = time.time()
# connect to MongoDB
client = MongoClient('') # Aadir URL a cluster de mongo db
# select database
db=client['tfm']
# select collection
collection_players=db['players']
collection_plus_minus=db['pairs_plus_minus']
numberOfClusters = 4
""" collection_pla... | 55.333333 | 153 | 0.601205 | from pymongo import MongoClient
import time
start = time.time()
# connect to MongoDB
client = MongoClient('') # Añadir URL a cluster de mongo db
# select database
db=client['tfm']
# select collection
collection_players=db['players']
collection_plus_minus=db['pairs_plus_minus']
numberOfClusters = 4
""" collection_pl... | 4 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6d3e1a37f700990b463d582723960903f49fa4af | 1,794 | py | Python | astwro/tools/__skeleton.py | majkelx/astwro | 4a9bbe3e4757c4076ad7c0d90cf08e38dab4e794 | [
"MIT"
] | 6 | 2017-06-15T20:34:51.000Z | 2020-04-15T14:21:43.000Z | astwro/tools/__skeleton.py | majkelx/astwro | 4a9bbe3e4757c4076ad7c0d90cf08e38dab4e794 | [
"MIT"
] | 18 | 2017-08-15T20:53:55.000Z | 2020-10-05T23:40:34.000Z | astwro/tools/__skeleton.py | majkelx/astwro | 4a9bbe3e4757c4076ad7c0d90cf08e38dab4e794 | [
"MIT"
] | 2 | 2017-11-06T15:33:53.000Z | 2020-10-02T21:06:05.000Z | #! /usr/bin/env python
# coding=utf-8
"""Copy this skeleton to start new tool
"""
from __future__ import print_function, division
# GLOBAL IMPORTS HERE
import __commons as commons
def __do(arg):
"""Main routine, common for command line, and python scripts call"""
# refer to args: arg.foo
# IMPLEMENT HERE... | 29.9 | 96 | 0.686734 | #! /usr/bin/env python
# coding=utf-8
"""Copy this skeleton to start new tool
"""
from __future__ import print_function, division
# GLOBAL IMPORTS HERE
import __commons as commons
def __do(arg):
"""Main routine, common for command line, and python scripts call"""
# refer to args: arg.foo
# IMPLEMENT HERE... | 0 | 0 | 0 | 0 | 0 | 734 | 0 | 0 | 69 |
3f5bc937f00adcc8ac849ad7eaf0d1cf4be70542 | 282 | py | Python | tests/test_sns.py | base2Services/alfajor | a88698901264ac041a418110b72de09c69253b54 | [
"MIT"
] | 2 | 2015-08-28T05:44:00.000Z | 2017-07-12T00:58:54.000Z | tests/test_sns.py | base2Services/alfajor | a88698901264ac041a418110b72de09c69253b54 | [
"MIT"
] | 1 | 2016-06-21T03:38:12.000Z | 2016-06-21T03:40:31.000Z | tests/test_sns.py | base2Services/alfajor | a88698901264ac041a418110b72de09c69253b54 | [
"MIT"
] | 11 | 2015-11-27T02:49:13.000Z | 2020-05-01T03:47:14.000Z | import boto.sns
from alfajor import aws_sns
import uuid
sns = aws_sns.SNS()
print sns
#exit()
message = "test"
subject = "test " + uuid.uuid4().urn[-12:]
print sns.send_message(message, subject)
#sns.send_message(message, subject, arn)
print sns.get_topics()
sns.show_topics()
| 15.666667 | 42 | 0.730496 | import boto.sns
from alfajor import aws_sns
import uuid
sns = aws_sns.SNS()
print sns
#exit()
message = "test"
subject = "test " + uuid.uuid4().urn[-12:]
print sns.send_message(message, subject)
#sns.send_message(message, subject, arn)
print sns.get_topics()
sns.show_topics()
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8af15b76daf52506b9af5d8cd64542fc004eca63 | 261,423 | py | Python | tests/unit/test_notebook.py | paw-lu/nbpreview | b7642c9e62a1a975864332ee31abec3cd4afce09 | [
"MIT"
] | 92 | 2021-12-13T08:48:55.000Z | 2022-03-29T14:40:28.000Z | tests/unit/test_notebook.py | paw-lu/nbpreview | b7642c9e62a1a975864332ee31abec3cd4afce09 | [
"MIT"
] | 314 | 2021-03-22T09:13:14.000Z | 2022-03-31T03:42:56.000Z | tests/unit/test_notebook.py | paw-lu/nbpreview | b7642c9e62a1a975864332ee31abec3cd4afce09 | [
"MIT"
] | 4 | 2022-01-17T04:45:18.000Z | 2022-03-11T04:03:30.000Z | """Test cases for render."""
import io
import json
import os
import pathlib
import textwrap
from pathlib import Path
from typing import (Any, Callable, ContextManager, Dict, Generator, Optional)
from unittest.mock import Mock
import httpx
import nbformat
from _pytest.config import _PluggyPlugin
from nbformat import No... | 45.655431 | 88 | 0.432227 | """Test cases for render."""
import dataclasses
import io
import json
import os
import pathlib
import re
import sys
import textwrap
from pathlib import Path
from typing import (
Any,
Callable,
ContextManager,
Dict,
Generator,
Optional,
Protocol,
Union,
)
from unittest.mock import Mock
i... | 28,572 | 27,537 | 0 | 799 | 0 | 0 | 0 | 71 | 294 |
9152baac28168519632ff872e523e7a5badd4d57 | 3,660 | py | Python | asgi_webdav/helpers.py | ported-pw/asgi-webdav | 78bf1efcb7658ab3ead92292ff7ca574dfc22641 | [
"MIT"
] | 38 | 2021-03-25T06:33:07.000Z | 2022-03-11T03:56:15.000Z | asgi_webdav/helpers.py | ported-pw/asgi-webdav | 78bf1efcb7658ab3ead92292ff7ca574dfc22641 | [
"MIT"
] | 15 | 2021-05-19T03:24:51.000Z | 2022-03-25T22:40:02.000Z | asgi_webdav/helpers.py | ported-pw/asgi-webdav | 78bf1efcb7658ab3ead92292ff7ca574dfc22641 | [
"MIT"
] | 8 | 2021-03-29T06:59:34.000Z | 2022-03-11T03:56:17.000Z | from typing import Optional, Union
import hashlib
from pathlib import Path
from mimetypes import guess_type as orig_guess_type
from asgi_webdav.config import Config
def generate_etag(f_size: [float, int], f_modify_time: float) -> str:
"""
https://tools.ietf.org/html/rfc7232#section-2.3 ETag
https://dev... | 25.957447 | 85 | 0.675956 | from typing import Optional, Union
import re
import hashlib
from pathlib import Path
from mimetypes import guess_type as orig_guess_type
from collections.abc import Callable, AsyncGenerator
import xmltodict
import aiofiles
from chardet import UniversalDetector
from asgi_webdav.constants import RESPONSE_DATA_BLOCK_SIZ... | 0 | 0 | 1,217 | 0 | 0 | 567 | 0 | 61 | 295 |
37e42bcec24043219412417c0ebf41008faa744a | 9,362 | py | Python | code/python/src/slub_docsa/experiments/qucosa/datasets.py | slub/docsa | c33a8243a60fbccbcd0a6418a59337e4ed39dc75 | [
"Apache-2.0"
] | 11 | 2022-01-05T17:19:10.000Z | 2022-02-14T18:57:37.000Z | code/python/src/slub_docsa/experiments/qucosa/datasets.py | slub/docsa | c33a8243a60fbccbcd0a6418a59337e4ed39dc75 | [
"Apache-2.0"
] | null | null | null | code/python/src/slub_docsa/experiments/qucosa/datasets.py | slub/docsa | c33a8243a60fbccbcd0a6418a59337e4ed39dc75 | [
"Apache-2.0"
] | null | null | null | """Provides various variants of the qucosa dataset."""
# pylint: disable=too-many-arguments
import logging
from typing import Callable, Iterator, List, Tuple
from slub_docsa.common.dataset import dataset_from_samples, samples_from_dataset
from slub_docsa.common.sample import Sample
from slub_docsa.common.subject im... | 43.747664 | 119 | 0.686605 | """Provides various variants of the qucosa dataset."""
# pylint: disable=too-many-arguments
import logging
import os
from typing import Callable, Iterator, List, Tuple, Union
from typing_extensions import Literal
from slub_docsa.common.dataset import Dataset, dataset_from_samples, samples_from_dataset
from slub_doc... | 0 | 0 | 0 | 0 | 925 | 1,494 | 0 | 327 | 253 |
c8703450c03228e05b606be7fa294a918a1e171e | 2,939 | py | Python | open/core/betterself/tests/views/test_activity_views.py | lawrendran/open | d136f694bafab647722c78be6f39ec79d589f774 | [
"MIT"
] | 105 | 2019-06-01T08:34:47.000Z | 2022-03-15T11:48:36.000Z | open/core/betterself/tests/views/test_activity_views.py | lawrendran/open | d136f694bafab647722c78be6f39ec79d589f774 | [
"MIT"
] | 111 | 2019-06-04T15:34:14.000Z | 2022-03-12T21:03:20.000Z | open/core/betterself/tests/views/test_activity_views.py | lawrendran/open | d136f694bafab647722c78be6f39ec79d589f774 | [
"MIT"
] | 26 | 2019-09-04T06:06:12.000Z | 2022-01-03T03:40:11.000Z | from django.contrib.auth import get_user_model
User = get_user_model()
"""
python manage.py test --pattern="*test_activity_views.py" --keepdb
"""
| 31.945652 | 114 | 0.7033 | from django.contrib.auth import get_user_model
from test_plus import TestCase
from open.core.betterself.constants import (
BetterSelfResourceConstants,
TEST_CONSTANTS,
)
from open.core.betterself.factories import ActivityFactory
from open.core.betterself.models.activity import Activity
from open.core.bettersel... | 0 | 0 | 0 | 2,347 | 0 | 0 | 0 | 285 | 157 |
a905247944f8cc6a2f7b3d7efc621c79ed6e1df0 | 2,536 | py | Python | apps/combine-api/src/handlers/omex_metadata/validate.py | freiburgermsu/biosimulations | 1c4f604f67c0924b58e1a3a45378c86bab7ace5b | [
"MIT"
] | 20 | 2021-09-05T02:47:07.000Z | 2022-01-25T10:46:47.000Z | apps/combine-api/src/handlers/omex_metadata/validate.py | freiburgermsu/biosimulations | 1c4f604f67c0924b58e1a3a45378c86bab7ace5b | [
"MIT"
] | 1,884 | 2020-08-23T17:40:26.000Z | 2021-09-01T16:29:20.000Z | apps/combine-api/src/handlers/omex_metadata/validate.py | freiburgermsu/biosimulations | 1c4f604f67c0924b58e1a3a45378c86bab7ace5b | [
"MIT"
] | 2 | 2019-11-04T15:08:05.000Z | 2020-01-02T21:17:51.000Z | from ...exceptions import BadRequestException
from ...utils import get_temp_file, make_validation_report
from biosimulators_utils.config import Config
from biosimulators_utils.omex_meta.data_model import OmexMetadataInputFormat, OmexMetadataSchema
from biosimulators_utils.omex_meta.io import read_omex_meta_file
import ... | 35.222222 | 96 | 0.664826 | from ...exceptions import BadRequestException
from ...utils import get_temp_file, make_validation_report
from biosimulators_utils.config import Config
from biosimulators_utils.omex_meta.data_model import OmexMetadataInputFormat, OmexMetadataSchema
from biosimulators_utils.omex_meta.io import read_omex_meta_file
import ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1c9383c816e7978483eb11dae73f07757bc58900 | 1,022 | py | Python | src/utils.py | iflament/metropulse | 274cbea1d10abcf00a207d7f5a11d6ba6386f684 | [
"MIT"
] | null | null | null | src/utils.py | iflament/metropulse | 274cbea1d10abcf00a207d7f5a11d6ba6386f684 | [
"MIT"
] | 8 | 2021-12-28T17:09:01.000Z | 2021-12-28T17:09:40.000Z | src/utils.py | iflament/cityflows | 274cbea1d10abcf00a207d7f5a11d6ba6386f684 | [
"MIT"
] | null | null | null | import psycopg2
import credentials
import logging
logger = logging.getLogger(__name__)
def connect():
"""Creates a connection to the Postgres database specified in the credentials file
Returns:Psycopg.connection: The database connection"""
config = {
'database': credentials.database,
'u... | 22.217391 | 86 | 0.629159 | import psycopg2
import credentials
import yaml
import logging
import time
from functools import wraps
logger = logging.getLogger(__name__)
def read_yaml(f):
with open(f, 'r') as file:
return yaml.safe_load(file.read())
def connect():
"""Creates a connection to the Postgres database specified in the... | 0 | 254 | 0 | 0 | 0 | 171 | 0 | -14 | 112 |
74cfe6a72dc33e2a850cad767893cf388a8fad79 | 310 | py | Python | .test/test/task1/aufgabe3_1.py | sowinski/testsubtree | d09b72e6b366e8e29e038445a1fa6987b2456625 | [
"MIT"
] | null | null | null | .test/test/task1/aufgabe3_1.py | sowinski/testsubtree | d09b72e6b366e8e29e038445a1fa6987b2456625 | [
"MIT"
] | null | null | null | .test/test/task1/aufgabe3_1.py | sowinski/testsubtree | d09b72e6b366e8e29e038445a1fa6987b2456625 | [
"MIT"
] | null | null | null |
zipfPlot(text1)
zipfPlot(text5)
| 19.375 | 39 | 0.625806 | from nltk.book import *
import pylab
def zipfPlot(text):
fdist = FreqDist(text)
vals = fdist.values()
pylab.plot(range(1, 31), vals[:30])
pylab.show()
pylab.plot(range(1, 31), vals[:30])
pylab.xscale('log')
pylab.yscale('log')
pylab.show()
zipfPlot(text1)
zipfPlot(text5)
| 0 | 0 | 0 | 0 | 0 | 218 | 0 | -7 | 66 |
9c528ab56aea43eaabd36ce8c87cd67d09f16a85 | 1,448 | py | Python | 00_Code/01_LeetCode/34_SearchforaRange.py | KartikKannapur/Data_Structures_and_Algorithms_Python | 66e3c8112826aeffb78bd74d02be1a8d1e478de8 | [
"MIT"
] | 1 | 2017-06-11T04:57:07.000Z | 2017-06-11T04:57:07.000Z | 00_Code/01_LeetCode/34_SearchforaRange.py | KartikKannapur/Data_Structures_and_Algorithms_Python | 66e3c8112826aeffb78bd74d02be1a8d1e478de8 | [
"MIT"
] | null | null | null | 00_Code/01_LeetCode/34_SearchforaRange.py | KartikKannapur/Data_Structures_and_Algorithms_Python | 66e3c8112826aeffb78bd74d02be1a8d1e478de8 | [
"MIT"
] | null | null | null | """
Given an array of integers sorted in ascending order, find the starting and ending position of a given target value.
Your algorithm's runtime complexity must be in the order of O(log n).
If the target is not found in the array, return [-1, -1].
For example,
Given [5, 7, 7, 8, 8, 10] and target value 8,
return [3... | 21.939394 | 116 | 0.495166 | """
Given an array of integers sorted in ascending order, find the starting and ending position of a given target value.
Your algorithm's runtime complexity must be in the order of O(log n).
If the target is not found in the array, return [-1, -1].
For example,
Given [5, 7, 7, 8, 8, 10] and target value 8,
return [3... | 0 | 0 | 0 | 1,039 | 0 | 0 | 0 | 0 | 23 |
4686636da9230c4a3c5af9f24717dcef055477e3 | 3,748 | py | Python | src/sparsify/blueprints/system.py | dhuangnm/sparsify | bf4c9abf8aa6f9b05a781ebb2637b0a3f042280a | [
"Apache-2.0"
] | 152 | 2021-02-04T17:25:12.000Z | 2022-03-24T21:05:16.000Z | src/sparsify/blueprints/system.py | markurtz/sparsify | 1afb88157cc7b9287e7f256b7b4696d198c23236 | [
"Apache-2.0"
] | 16 | 2021-02-22T03:40:28.000Z | 2022-03-14T15:22:36.000Z | src/sparsify/blueprints/system.py | markurtz/sparsify | 1afb88157cc7b9287e7f256b7b4696d198c23236 | [
"Apache-2.0"
] | 17 | 2021-02-04T20:52:26.000Z | 2022-02-07T11:55:18.000Z | # Copyright (c) 2021 - present / Neuralmagic, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 32.591304 | 86 | 0.653148 | # Copyright (c) 2021 - present / Neuralmagic, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 0 | 2,509 | 0 | 0 | 0 | 0 | 0 | 129 | 135 |
ab0331ddc003874fffcde0d3d4368dba2d3f6a41 | 952 | py | Python | src/dakara_player/mrl.py | DakaraProject/dakara-player | 6690c4c29506d0162382cc38a41f95850d5831ba | [
"MIT"
] | 3 | 2018-07-24T23:08:51.000Z | 2020-01-24T16:30:27.000Z | src/dakara_player/mrl.py | DakaraProject/dakara-player-vlc | 6690c4c29506d0162382cc38a41f95850d5831ba | [
"MIT"
] | 36 | 2018-03-06T13:43:42.000Z | 2021-01-16T18:30:37.000Z | src/dakara_player/mrl.py | DakaraProject/dakara-player | 6690c4c29506d0162382cc38a41f95850d5831ba | [
"MIT"
] | 1 | 2020-01-20T20:52:00.000Z | 2020-01-20T20:52:00.000Z | """Manage MRL."""
import pathlib
from urllib.parse import unquote, urlparse
from path import Path
def mrl_to_path(file_mrl):
"""Convert a MRL to a filesystem path.
File path is stored as MRL inside a media object, we have to bring it back
to a more classic looking path format.
Args:
file_m... | 23.8 | 78 | 0.655462 | """Manage MRL."""
import pathlib
from urllib.parse import unquote, urlparse
from path import Path
def mrl_to_path(file_mrl):
"""Convert a MRL to a filesystem path.
File path is stored as MRL inside a media object, we have to bring it back
to a more classic looking path format.
Args:
file_m... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5511aa66c5278d82155a7337cbfed553136ae13b | 10,685 | py | Python | inac8hr/hud/level1.py | th-bunratta/8hr.insomniac | 5173500a1ad7197096d513b38258aa65b035fcf3 | [
"BSD-3-Clause"
] | null | null | null | inac8hr/hud/level1.py | th-bunratta/8hr.insomniac | 5173500a1ad7197096d513b38258aa65b035fcf3 | [
"BSD-3-Clause"
] | null | null | null | inac8hr/hud/level1.py | th-bunratta/8hr.insomniac | 5173500a1ad7197096d513b38258aa65b035fcf3 | [
"BSD-3-Clause"
] | null | null | null |
#
# the Jumping Ballot
#
# TODO: Add an InspectorPanel.
#
| 42.569721 | 173 | 0.696771 | from inac8hr.gui import *
from inac8hr.scenes.layers import *
from inac8hr.anim import SceneSequence, SequenceInfo, ExponentialEaseOut, QuadEaseIn, TemporalSequence
from inac8hr.entities import In8acUnitInfo
from inac8hr.commands import CommandHandler
from inac8hr.tools import ToolHandler
from inac8hr.globals import GA... | 0 | 0 | 0 | 10,261 | 0 | 0 | 0 | 165 | 199 |
295393fefd365765280dfb0eb52b712d0284aefa | 5,847 | py | Python | checklist/views/views_bookupsearcateg.py | cagandhi/Checklist-Django | c8edf1d8f821900a71f36abd34a76663d8d8f7da | [
"Apache-2.0"
] | 3 | 2021-07-02T07:35:19.000Z | 2022-01-14T11:14:14.000Z | checklist/views/views_bookupsearcateg.py | cagandhi/Checklist-Django | c8edf1d8f821900a71f36abd34a76663d8d8f7da | [
"Apache-2.0"
] | 57 | 2021-01-31T23:39:57.000Z | 2022-03-12T00:47:23.000Z | checklist/views/views_bookupsearcateg.py | cagandhi/Checklist-Django | c8edf1d8f821900a71f36abd34a76663d8d8f7da | [
"Apache-2.0"
] | 3 | 2021-08-29T21:46:54.000Z | 2022-03-24T13:10:00.000Z | # mixins for checking if user is logged in and the checklist author is the same as logged in user
# VIEW BOOKMARKS PAGE
# VIEW UPVOTE PAGE
# SEARCH RESULTS PAGE
# DISPLAY CHECKLISTS FOR A CATEGORY PAGE
| 32.483333 | 97 | 0.657089 | # mixins for checking if user is logged in and the checklist author is the same as logged in user
from django.contrib.auth.mixins import LoginRequiredMixin
from django.db.models import Q
from django.shortcuts import get_object_or_404
from django.views.generic import ListView
from checklist.models import Bookmark, Cate... | 0 | 0 | 0 | 5,231 | 0 | 0 | 0 | 184 | 222 |
7237412321995abfe205a1a6101d26198595a0ae | 97 | py | Python | PythonFiles/ifelse.py | IamVaibhavsar/Python_Files | 283d73929a3e11955c71499407c4f8bff56e4273 | [
"MIT"
] | null | null | null | PythonFiles/ifelse.py | IamVaibhavsar/Python_Files | 283d73929a3e11955c71499407c4f8bff56e4273 | [
"MIT"
] | null | null | null | PythonFiles/ifelse.py | IamVaibhavsar/Python_Files | 283d73929a3e11955c71499407c4f8bff56e4273 | [
"MIT"
] | 1 | 2019-07-26T15:25:21.000Z | 2019-07-26T15:25:21.000Z | is_male=False
if is_male:
print("you are male.")
else:
print("You are female.")
| 12.125 | 29 | 0.587629 | is_male=False
if is_male:
print("you are male.")
else:
print("You are female.")
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4074c06187bcc3a01985ee11d8d2df26fd88c0ba | 17,487 | py | Python | NearAxisGK.py | rogeriojorge/NearAxisGyrokinetics | e070da73efe6f4ceec56f8683c8b95a41565aea6 | [
"MIT"
] | null | null | null | NearAxisGK.py | rogeriojorge/NearAxisGyrokinetics | e070da73efe6f4ceec56f8683c8b95a41565aea6 | [
"MIT"
] | null | null | null | NearAxisGK.py | rogeriojorge/NearAxisGyrokinetics | e070da73efe6f4ceec56f8683c8b95a41565aea6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
################################################
################################################
number_of_field_periods_to_include = 2
normalizedfluxvec = [0.01,0.05,0.1,0.3,0.5,0.8]
N_phi = 200 #Number of points for B0, B1 and B2 calculation and plotting
plotSave = 1 #Spend time plotting resu... | 46.756684 | 331 | 0.679305 | #!/usr/bin/env python3
################################################
################################################
number_of_field_periods_to_include = 2
normalizedfluxvec = [0.01,0.05,0.1,0.3,0.5,0.8]
N_phi = 200 #Number of points for B0, B1 and B2 calculation and plotting
plotSave = 1 #Spend time plotting resu... | 0 | 0 | 0 | 0 | 0 | 2,501 | 0 | 6 | 22 |
ed2d4f3d4617a80c1351020a3c1077973d29df81 | 1,532 | py | Python | subscriptions/services.py | andela-cnnadi/pubsubservices | 7a356e841009a934d1c9ed28b337d808bea90ef0 | [
"MIT"
] | null | null | null | subscriptions/services.py | andela-cnnadi/pubsubservices | 7a356e841009a934d1c9ed28b337d808bea90ef0 | [
"MIT"
] | null | null | null | subscriptions/services.py | andela-cnnadi/pubsubservices | 7a356e841009a934d1c9ed28b337d808bea90ef0 | [
"MIT"
] | null | null | null | import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from munch import Munch
'''
Signals
munch.subscription.create -> Create a new subscription
munch.subscription.delete -> Deletes an existing subscription
munch.subscription.update -> Updates an existing subscription
munch.subscript... | 23.212121 | 102 | 0.715405 | import sys
import os
import signal
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from munch import Munch
'''
Signals
munch.subscription.create -> Create a new subscription
munch.subscription.delete -> Deletes an existing subscription
munch.subscription.update -> Updates an existing subscription
m... | 0 | 529 | 0 | 0 | 0 | 0 | 0 | -8 | 68 |
a8ce20aae254436b83b05483a18a8c8abe4dd7b4 | 860 | py | Python | medium/flatten a multilevel doubly linked list/solution.py | ilya-sokolov/leetcode | ad421111d0d7c5ec5245f33552e94a373b6fd426 | [
"MIT"
] | 4 | 2021-06-03T22:19:13.000Z | 2021-10-05T18:14:12.000Z | medium/flatten a multilevel doubly linked list/solution.py | ilya-sokolov/leetcode | ad421111d0d7c5ec5245f33552e94a373b6fd426 | [
"MIT"
] | null | null | null | medium/flatten a multilevel doubly linked list/solution.py | ilya-sokolov/leetcode | ad421111d0d7c5ec5245f33552e94a373b6fd426 | [
"MIT"
] | null | null | null | # Definition for a Node.
s = Solution()
print(s.flatten(Node(None, None, None, None)))
| 23.243243 | 52 | 0.50814 | # Definition for a Node.
from typing import Optional
class Node:
def __init__(self, val, prev, next, child):
self.val = val
self.prev = prev
self.next = next
self.child = child
class Solution:
def flatten(self, head: Node) -> Optional[Node]:
if not head:
r... | 0 | 0 | 0 | 695 | 0 | 0 | 0 | 6 | 68 |
0b2e0fc476eaba8c61ac424a6107d61a92dd338c | 179 | py | Python | cellpy/utils/live.py | lithium-ion/cellpy | 5345912dbd51a8f546542ef7797a074aac9ba3c7 | [
"MIT"
] | 38 | 2016-08-16T10:54:56.000Z | 2022-03-03T04:43:20.000Z | cellpy/utils/live.py | Ozzstein/cellpy | ee532905741db4cb928303d75426d2a4fa77144a | [
"MIT"
] | 88 | 2016-08-16T13:10:27.000Z | 2022-03-29T10:36:39.000Z | cellpy/utils/live.py | Ozzstein/cellpy | ee532905741db4cb928303d75426d2a4fa77144a | [
"MIT"
] | 13 | 2019-01-02T03:57:52.000Z | 2022-01-19T08:06:49.000Z | """Routines for streaming cell data"""
import warnings
import logging
logging.captureWarnings(True)
if __name__ == "__main__":
warnings.warn("to be implemented")
| 16.272727 | 38 | 0.748603 | """Routines for streaming cell data"""
import os
import warnings
import logging
logging.captureWarnings(True)
if __name__ == "__main__":
warnings.warn("to be implemented")
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | -12 | 23 |