hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | 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 125 | 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 125 | 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.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d06ad21aa10ccffae0d63d49f3b4c9376f1ddc1f | 3,333 | py | Python | image-eso.py | osmarks/random-stuff | 78602eabd69aebfa061cf201a4d44555fa9a36e7 | [
"MIT"
] | 4 | 2021-02-04T15:09:14.000Z | 2021-12-19T10:54:59.000Z | image-eso.py | osmarks/random-stuff | 78602eabd69aebfa061cf201a4d44555fa9a36e7 | [
"MIT"
] | null | null | null | image-eso.py | osmarks/random-stuff | 78602eabd69aebfa061cf201a4d44555fa9a36e7 | [
"MIT"
] | 1 | 2021-12-19T22:05:07.000Z | 2021-12-19T22:05:07.000Z | from PIL import Image
import random
im = Image.open("/tmp/out.png")
px = im.load()
rng = random.Random()
COMMANDS = 18
size = im.size
position = (0, 0)
direction = (1, 0)
matrix_1 = ((0, 1), (-1, 0))
matrix_2 = ((0, -1), (1, 0))
stack = []
inbuf = ["b", "e", "e", "s", "i", "n", "c", "u", "r", "s", "e"]
while True:
... | 27.319672 | 97 | 0.508551 | from PIL import Image
import random
im = Image.open("/tmp/out.png")
px = im.load()
rng = random.Random()
def randomize(x, pos, m):
rng.seed(bytes(x) + pos[0].to_bytes(4, "little") + pos[1].to_bytes(4, "little"), 2)
return rng.randint(0, m), rng.randint(0, 255)
COMMANDS = 18
size = im.size
position = (0, 0)
d... | 316 | 288 | 67 |
082e570f2de4b9eee5e54397481981f401d3fc94 | 3,131 | py | Python | dpd/uscensus/download_lodes.py | davidbailey/dpd | 29bce937e34afa2161788a5c4a911e590a388229 | [
"MIT"
] | 6 | 2020-08-13T22:21:25.000Z | 2021-09-15T19:12:51.000Z | dpd/uscensus/download_lodes.py | davidbailey/dpd | 29bce937e34afa2161788a5c4a911e590a388229 | [
"MIT"
] | 3 | 2018-01-25T09:11:01.000Z | 2020-12-22T17:31:24.000Z | dpd/uscensus/download_lodes.py | davidbailey/dpd | 29bce937e34afa2161788a5c4a911e590a388229 | [
"MIT"
] | null | null | null | from dpd.utils import download_file
def download_lodes_data(data, st, part_or_seg, type_, year):
"""
Download LODES OD file. APIS documentation from here: https://lehd.ces.census.gov/data/lodes/LODES7/LODESTechDoc7.4.pdf
Args:
data (str): one of "od", "rac", or "wac"
e.g. "od"
... | 41.746667 | 576 | 0.586714 | from dpd.utils import download_file
def download_lodes_data(data, st, part_or_seg, type_, year):
"""
Download LODES OD file. APIS documentation from here: https://lehd.ces.census.gov/data/lodes/LODES7/LODESTechDoc7.4.pdf
Args:
data (str): one of "od", "rac", or "wac"
e.g. "od"
... | 0 | 0 | 0 |
98864ace31480e5ce14d8d87c7d89a17b38aae66 | 13,493 | py | Python | src/ovirtcli/format/text.py | oVirt/ovirt-engine-cli | 422d70e1dc422f0ca248abea47a472e3605caa4b | [
"Apache-2.0"
] | 4 | 2015-11-29T08:53:03.000Z | 2022-02-05T14:10:24.000Z | src/ovirtcli/format/text.py | oVirt/ovirt-engine-cli | 422d70e1dc422f0ca248abea47a472e3605caa4b | [
"Apache-2.0"
] | null | null | null | src/ovirtcli/format/text.py | oVirt/ovirt-engine-cli | 422d70e1dc422f0ca248abea47a472e3605caa4b | [
"Apache-2.0"
] | 4 | 2015-02-06T02:06:53.000Z | 2020-03-24T07:13:05.000Z | #
# Copyright (c) 2010 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | 48.189286 | 173 | 0.477952 | #
# Copyright (c) 2010 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | 12,003 | 108 | 239 |
b3adc2a9d590d573c3ad57305e25bd01ca5345d6 | 4,705 | py | Python | scripts/argumentos_at.py | phabel-LD/python_class-2 | ac21d0d0e0e46c345dbcdb8cc0f47c11c17bff6b | [
"MIT"
] | null | null | null | scripts/argumentos_at.py | phabel-LD/python_class-2 | ac21d0d0e0e46c345dbcdb8cc0f47c11c17bff6b | [
"MIT"
] | null | null | null | scripts/argumentos_at.py | phabel-LD/python_class-2 | ac21d0d0e0e46c345dbcdb8cc0f47c11c17bff6b | [
"MIT"
] | null | null | null | '''
NAME
argumentos_at.py
VERSION
[1.0]
AUTHOR
Daianna Gonzalez Padilla <daianna@lcg.unam.mx>
DESCRIPTION
This programs gets a file with one or more dna sequences and returns an output file with the AT content
of each sequence, from the command line
CATEGORY
DNA sequence analysis
USAGE
... | 35.11194 | 113 | 0.62763 | '''
NAME
argumentos_at.py
VERSION
[1.0]
AUTHOR
Daianna Gonzalez Padilla <daianna@lcg.unam.mx>
DESCRIPTION
This programs gets a file with one or more dna sequences and returns an output file with the AT content
of each sequence, from the command line
CATEGORY
DNA sequence analysis
USAGE
... | 2,094 | 0 | 44 |
e0fc060a3e55ca4577fede87691a77acbe281033 | 1,903 | py | Python | users/migrations/0001_initial.py | hhdMrLion/DJANGO_CRM | 1f8d2d7a025f9dc54b5bf498e7a577469f74c612 | [
"Apache-2.0"
] | 1 | 2021-06-18T03:03:46.000Z | 2021-06-18T03:03:46.000Z | users/migrations/0001_initial.py | hhdMrLion/DJANGO_CRM | 1f8d2d7a025f9dc54b5bf498e7a577469f74c612 | [
"Apache-2.0"
] | null | null | null | users/migrations/0001_initial.py | hhdMrLion/DJANGO_CRM | 1f8d2d7a025f9dc54b5bf498e7a577469f74c612 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2020-09-28 03:34
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
| 43.25 | 141 | 0.596952 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2020-09-28 03:34
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
... | 0 | 1,841 | 25 |
08f97b92295c3c29eff10b9ee0006f0dca2d439f | 1,286 | py | Python | commerce/admin.py | PrestonMonteWest/comp-mart | e7699f3c4ac1d77c447cd9300fb9912f4840d2a9 | [
"Apache-2.0"
] | 1 | 2018-04-09T02:06:30.000Z | 2018-04-09T02:06:30.000Z | commerce/admin.py | PrestonMonteWest/compmart | e7699f3c4ac1d77c447cd9300fb9912f4840d2a9 | [
"Apache-2.0"
] | 1 | 2018-07-04T21:08:58.000Z | 2018-07-09T02:34:50.000Z | commerce/admin.py | PrestonMonteWest/compmart | e7699f3c4ac1d77c447cd9300fb9912f4840d2a9 | [
"Apache-2.0"
] | null | null | null | from django.contrib import admin
from . import models
admin.site.register(models.Product, ProductAdmin)
admin.site.register(models.Review, ReviewAdmin)
admin.site.register(models.Order, OrderAdmin)
| 36.742857 | 80 | 0.66874 | from django.contrib import admin
from . import models
class OrderItemInline(admin.TabularInline):
fields = ('product', 'quantity')
raw_id_fields = ('product',)
model = models.OrderItem
extra = 1
class ProductAdmin(admin.ModelAdmin):
list_display = ('name', 'price', 'description', 'stock', 'discont... | 0 | 995 | 92 |
ae0f8d2404360860d62fb249f2d3aa6934c5170c | 1,730 | py | Python | scripts/financials.py | pwaring/125-accounts | a8d577110184e5f833368977c36b1e407c7357f6 | [
"MIT"
] | null | null | null | scripts/financials.py | pwaring/125-accounts | a8d577110184e5f833368977c36b1e407c7357f6 | [
"MIT"
] | 7 | 2017-04-30T11:11:26.000Z | 2020-09-24T15:23:24.000Z | scripts/financials.py | pwaring/125-accounts | a8d577110184e5f833368977c36b1e407c7357f6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import argparse
import yaml
import pathlib
import decimal
import datetime
import os
decimal.getcontext().prec = 10
parser = argparse.ArgumentParser()
parser.add_argument('--data', help='path to data directory', required=True)
args = parser.parse_args()
script_path = os.path.dirname(os.path.re... | 28.833333 | 181 | 0.695954 | #!/usr/bin/env python3
import argparse
import yaml
import pathlib
import decimal
import datetime
import os
decimal.getcontext().prec = 10
parser = argparse.ArgumentParser()
parser.add_argument('--data', help='path to data directory', required=True)
args = parser.parse_args()
script_path = os.path.dirname(os.path.re... | 0 | 0 | 0 |
25efef0373814a37ec3b036dce7073a24aa9cde9 | 2,343 | py | Python | setup.py | Multiplicom/wanna-transfer | 4a0b35e9b2c54395b53221f3b796343d9341173b | [
"MIT"
] | 2 | 2018-06-06T16:04:20.000Z | 2018-10-18T12:17:38.000Z | setup.py | Multiplicom/wanna-transfer | 4a0b35e9b2c54395b53221f3b796343d9341173b | [
"MIT"
] | 15 | 2018-01-11T10:16:11.000Z | 2020-02-18T08:23:12.000Z | setup.py | Multiplicom/wanna-transfer | 4a0b35e9b2c54395b53221f3b796343d9341173b | [
"MIT"
] | 1 | 2018-02-20T19:27:09.000Z | 2018-02-20T19:27:09.000Z | """
Wanna-transfer
--------------
Wanna-transfer is a python based tool to
efficient upload and download large files to and from the cloud.
It is easy to setup
```````````````````
And run it:
.. code:: bash
$ pip install wanna-transfer
$ wanna -h
Links
`````
* `development
<https://github.com/Multiplicom/w... | 27.892857 | 88 | 0.618865 | """
Wanna-transfer
--------------
Wanna-transfer is a python based tool to
efficient upload and download large files to and from the cloud.
It is easy to setup
```````````````````
And run it:
.. code:: bash
$ pip install wanna-transfer
$ wanna -h
Links
`````
* `development
<https://github.com/Multiplicom/w... | 311 | 0 | 46 |
4547d0d41da10b58bef3135ba608a2c0f405d4b5 | 282 | py | Python | src/parseCoverageReport.py | LASER-UMASS/Swami | feaa5e091b7c2514db5106eba39f7ffbfa6ed408 | [
"MIT"
] | 9 | 2019-02-25T16:12:31.000Z | 2022-01-18T02:39:50.000Z | src/parseCoverageReport.py | sophiatong/Swami-Additional | feaa5e091b7c2514db5106eba39f7ffbfa6ed408 | [
"MIT"
] | null | null | null | src/parseCoverageReport.py | sophiatong/Swami-Additional | feaa5e091b7c2514db5106eba39f7ffbfa6ed408 | [
"MIT"
] | 5 | 2019-11-21T06:51:40.000Z | 2022-01-18T02:40:08.000Z | """Extract all tables from an html file, printing and saving each to csv file."""
import pandas as pd
import sys
df_list = pd.read_html(sys.argv[1])
df = pd.DataFrame((df_list[0]))
for index, row in df.iterrows():
print row['Element'],"::", row['Cov.'], "::", row['Cov..1']
| 23.5 | 81 | 0.648936 | """Extract all tables from an html file, printing and saving each to csv file."""
import pandas as pd
import sys
df_list = pd.read_html(sys.argv[1])
df = pd.DataFrame((df_list[0]))
for index, row in df.iterrows():
print row['Element'],"::", row['Cov.'], "::", row['Cov..1']
| 0 | 0 | 0 |
97cef5ed02722ef12836a72d979af4079d5745b2 | 426 | py | Python | pyleecan/Methods/Material/ModelBH/get_BH.py | tobsen2code/pyleecan | 5b1ded9e389e0c79ed7b7c878b6e939f2d9962e9 | [
"Apache-2.0"
] | 95 | 2019-01-23T04:19:45.000Z | 2022-03-17T18:22:10.000Z | pyleecan/Methods/Material/ModelBH/get_BH.py | ecs-kev/pyleecan | 1faedde4b24acc6361fa1fdd4e980eaec4ca3a62 | [
"Apache-2.0"
] | 366 | 2019-02-20T07:15:08.000Z | 2022-03-31T13:37:23.000Z | pyleecan/Methods/Material/ModelBH/get_BH.py | ecs-kev/pyleecan | 1faedde4b24acc6361fa1fdd4e980eaec4ca3a62 | [
"Apache-2.0"
] | 74 | 2019-01-24T01:47:31.000Z | 2022-02-25T05:44:42.000Z | # -*- coding: utf-8 -*-
from numpy import array, linspace, pi
import numpy as np
from scipy.optimize import curve_fit, root_scalar
def get_BH(self):
"""
Return the B(H) curve of the material (by default do nothing).
Parameters
----------
self : ModelBH
a ModelBH object
Returns
--... | 17.75 | 66 | 0.593897 | # -*- coding: utf-8 -*-
from numpy import array, linspace, pi
import numpy as np
from scipy.optimize import curve_fit, root_scalar
def get_BH(self):
"""
Return the B(H) curve of the material (by default do nothing).
Parameters
----------
self : ModelBH
a ModelBH object
Returns
--... | 0 | 0 | 0 |
0e4df3404e18896ae0f55afd4ce7fd57f74c484b | 871 | py | Python | build-deployment/build_local.py | MIT-Mobile/MIT-Mobile-for-Android | 82c093cab343b8c72bfc6375d9e96c6a7cb5be7d | [
"MIT"
] | 21 | 2015-04-09T08:19:04.000Z | 2021-04-16T01:59:41.000Z | build-deployment/build_local.py | justinanderson/MIT-Mobile-for-Android | 82c093cab343b8c72bfc6375d9e96c6a7cb5be7d | [
"MIT"
] | 12 | 2015-01-06T21:20:08.000Z | 2016-01-13T16:24:56.000Z | build-deployment/build_local.py | MIT-Mobile/MIT-Mobile-for-Android | 82c093cab343b8c72bfc6375d9e96c6a7cb5be7d | [
"MIT"
] | 12 | 2015-01-22T13:33:10.000Z | 2019-05-07T06:32:11.000Z | #!/usr/bin/python
import sys
import os
import build_include
""" parameters -- tag: the git tag or branch to use, fast: use git pull versus git clone
zero parameters means build local source without pulling from git"""
if len(sys.argv) > 1:
tag = sys.argv[1]
else:
tag = False
if len(sys.argv) > 2:
... | 24.194444 | 94 | 0.692308 | #!/usr/bin/python
import sys
import os
import build_include
""" parameters -- tag: the git tag or branch to use, fast: use git pull versus git clone
zero parameters means build local source without pulling from git"""
if len(sys.argv) > 1:
tag = sys.argv[1]
else:
tag = False
if len(sys.argv) > 2:
... | 0 | 0 | 0 |
8df4d16c244a374e0505de272ff213a86c20d408 | 1,488 | py | Python | scripts/generate_openapi.py | sillsdev/TheCombine | d8f87c464c5a770019d55eefb3dc6a276ab9da13 | [
"MIT"
] | 14 | 2019-06-14T23:18:04.000Z | 2021-09-04T03:28:32.000Z | scripts/generate_openapi.py | sillsdev/TheCombine | d8f87c464c5a770019d55eefb3dc6a276ab9da13 | [
"MIT"
] | 1,114 | 2019-06-05T15:40:26.000Z | 2022-03-29T16:07:37.000Z | scripts/generate_openapi.py | sillsdev/TheCombine | d8f87c464c5a770019d55eefb3dc6a276ab9da13 | [
"MIT"
] | 9 | 2019-07-31T13:41:15.000Z | 2021-12-06T16:50:02.000Z | #!/usr/bin/env python3
"""Regenerate the frontend OpenAPI bindings to the backend.
Requirements:
- npm/node installed and in PATH
- java 8+ installed and in PATH
"""
import os
from pathlib import Path
import shutil
from typing import List
EXIT_SUCCESS = 0
if __name__ == "__main__":
main()
| 29.176471 | 98 | 0.639785 | #!/usr/bin/env python3
"""Regenerate the frontend OpenAPI bindings to the backend.
Requirements:
- npm/node installed and in PATH
- java 8+ installed and in PATH
"""
import os
from pathlib import Path
import shutil
from typing import List
EXIT_SUCCESS = 0
def execute(command: List[str], check: bool = True... | 1,132 | 0 | 46 |
71608858b11e3f468fbe421bef53b0c8f8ec86fa | 15,869 | py | Python | utils/data_simulator.py | HazyResearch/ivy-tutorial | 305ae5a59f80d42a996f9f6381c72349eb35bd1e | [
"Apache-2.0"
] | 6 | 2020-06-04T18:08:24.000Z | 2022-02-20T04:49:02.000Z | utils/data_simulator.py | HazyResearch/ivy-tutorial | 305ae5a59f80d42a996f9f6381c72349eb35bd1e | [
"Apache-2.0"
] | null | null | null | utils/data_simulator.py | HazyResearch/ivy-tutorial | 305ae5a59f80d42a996f9f6381c72349eb35bd1e | [
"Apache-2.0"
] | 1 | 2021-11-15T17:06:43.000Z | 2021-11-15T17:06:43.000Z | import numpy as np
import networkx as nx
import itertools as it
import pandas as pd
from pgmpy.models import MarkovModel
from pgmpy.factors.discrete import DiscreteFactor
import pylab as plt
from utils.utils import IsingModel, factor2Df, sampling
from collections import Counter
from pgmpy.models import BayesianModel
fr... | 37.251174 | 122 | 0.571807 | import numpy as np
import networkx as nx
import itertools as it
import pandas as pd
from pgmpy.models import MarkovModel
from pgmpy.factors.discrete import DiscreteFactor
import pylab as plt
from utils.utils import IsingModel, factor2Df, sampling
from collections import Counter
from pgmpy.models import BayesianModel
fr... | 12,052 | 3,145 | 258 |
6f69eb1be4adecc6264b05f55189f4a39a849b14 | 1,989 | py | Python | 70-79/73.py | NiCrook/Ebabit_Exercises | 235f63e3b6053cbad05d7a3a97595deef085779c | [
"MIT"
] | null | null | null | 70-79/73.py | NiCrook/Ebabit_Exercises | 235f63e3b6053cbad05d7a3a97595deef085779c | [
"MIT"
] | null | null | null | 70-79/73.py | NiCrook/Ebabit_Exercises | 235f63e3b6053cbad05d7a3a97595deef085779c | [
"MIT"
] | null | null | null | # https://edabit.com/challenge/76ibd8jZxvhAwDskb
#
# A city skyline can be represented as a 2-D list with 1s representing buildings. In the example below, the height of
# the tallest building is 4 (second-most right column).
#
# [[0, 0, 0, 0, 0, 0],
# [0, 0, 0, 0, 1, 0],
# [0, 0, 1, 0, 1, 0],
# [0, 1, 1, 1, 1, 0],
# [1... | 22.602273 | 117 | 0.533937 | # https://edabit.com/challenge/76ibd8jZxvhAwDskb
#
# A city skyline can be represented as a 2-D list with 1s representing buildings. In the example below, the height of
# the tallest building is 4 (second-most right column).
#
# [[0, 0, 0, 0, 0, 0],
# [0, 0, 0, 0, 1, 0],
# [0, 0, 1, 0, 1, 0],
# [0, 1, 1, 1, 1, 0],
# [1... | 884 | 0 | 23 |
45171d5dbe0e7a28c4085bc10ef266e011e2b134 | 12,848 | py | Python | coniql/simplugin.py | callumforrester/coniql | 6b0b217d37a93acc680946b8eb2a40db0da551d2 | [
"Apache-2.0"
] | null | null | null | coniql/simplugin.py | callumforrester/coniql | 6b0b217d37a93acc680946b8eb2a40db0da551d2 | [
"Apache-2.0"
] | null | null | null | coniql/simplugin.py | callumforrester/coniql | 6b0b217d37a93acc680946b8eb2a40db0da551d2 | [
"Apache-2.0"
] | null | null | null | from __future__ import annotations
import asyncio
import json
import math
import time
from asyncio import Queue
import dataclasses
from dataclasses import dataclass
from typing import Dict, Type, Set, TypeVar, Generic, List, Any
import numpy as np
from coniql.util import doc_field
from .plugin import Plugin
from ._t... | 35.888268 | 86 | 0.605464 | from __future__ import annotations
import asyncio
import json
import math
import time
from asyncio import Queue
import dataclasses
from dataclasses import dataclass
from typing import Dict, Type, Set, TypeVar, Generic, List, Any
import numpy as np
from coniql.util import doc_field
from .plugin import Plugin
from ._t... | 9,769 | 351 | 637 |
3042ea44e8d6cea2ff000f2c606d371c9d9725dd | 872 | py | Python | set2/python/p14.py | tkuriyama/cryptopals | 1fce06e4e230a0e88a1339f08335fffcef14419f | [
"MIT"
] | null | null | null | set2/python/p14.py | tkuriyama/cryptopals | 1fce06e4e230a0e88a1339f08335fffcef14419f | [
"MIT"
] | null | null | null | set2/python/p14.py | tkuriyama/cryptopals | 1fce06e4e230a0e88a1339f08335fffcef14419f | [
"MIT"
] | null | null | null | import utils
def main():
"""Main."""
code_b64 = 'Um9sbGluJyBpbiBteSA1LjAKV2l0aCBteSByYWctdG9wIGRvd24gc28gbXkg'
code_b64 += 'aGFpciBjYW4gYmxvdwpUaGUgZ2lybGllcyBvbiBzdGFuZGJ5IHdhdmluZyBq'
code_b64 += 'dXN0IHRvIHNheSBoaQpEaWQgeW91IHN0b3A/IE5vLCBJIGp1c3QgZHJvdmUg'
code_b64 += 'YnkK'
code = bytearra... | 32.296296 | 78 | 0.659404 | import utils
def main():
"""Main."""
code_b64 = 'Um9sbGluJyBpbiBteSA1LjAKV2l0aCBteSByYWctdG9wIGRvd24gc28gbXkg'
code_b64 += 'aGFpciBjYW4gYmxvdwpUaGUgZ2lybGllcyBvbiBzdGFuZGJ5IHdhdmluZyBq'
code_b64 += 'dXN0IHRvIHNheSBoaQpEaWQgeW91IHN0b3A/IE5vLCBJIGp1c3QgZHJvdmUg'
code_b64 += 'YnkK'
code = bytearra... | 0 | 0 | 0 |
1d451206b49146f3f83ab3491725f6ee28a94c82 | 162 | py | Python | examples/restaurant_tutorial/restaurant_state_pool/move/Move_ZAKBFJ/script.py | DLR-RM/rafcon-task-planner-plugin | 9d004c76aa6f54c992a2f3f00b9dd98f9fb4e498 | [
"BSD-3-Clause"
] | 1 | 2020-05-21T17:08:02.000Z | 2020-05-21T17:08:02.000Z | test/logic/test_data/test_state_pool/go_to/Go_to_ZAKBFJ/script.py | DLR-RM/rafcon-task-planner-plugin | 9d004c76aa6f54c992a2f3f00b9dd98f9fb4e498 | [
"BSD-3-Clause"
] | null | null | null | test/logic/test_data/test_state_pool/go_to/Go_to_ZAKBFJ/script.py | DLR-RM/rafcon-task-planner-plugin | 9d004c76aa6f54c992a2f3f00b9dd98f9fb4e498 | [
"BSD-3-Clause"
] | null | null | null | import time
| 27 | 75 | 0.67284 | import time
def execute(self, inputs, outputs, gvm):
self.logger.info(inputs['name']+' is moving to '+inputs['destination'])
time.sleep(0.5)
return 0
| 128 | 0 | 22 |
aafa300cff88d9dacf2f755dff8458d8b017222b | 478 | py | Python | Day-06/part2.py | archanpatkar/advent2021 | 8e0780cd28b5825af092e4ba8e3d9cd1059bce92 | [
"MIT"
] | null | null | null | Day-06/part2.py | archanpatkar/advent2021 | 8e0780cd28b5825af092e4ba8e3d9cd1059bce92 | [
"MIT"
] | null | null | null | Day-06/part2.py | archanpatkar/advent2021 | 8e0780cd28b5825af092e4ba8e3d9cd1059bce92 | [
"MIT"
] | null | null | null | import sys
sys.path.append("..")
from common import *
data = fnl(parse)[0]
school = data
print(data)
days = 256
rate = 7
track = [0 for i in range(rate+2)]
for fish in range(len(school)):
track[school[fish]] += 1
pprint(track)
for day in range(days):
day0 = track[0]
track = track[1:]
track.appe... | 16.482759 | 49 | 0.585774 | import sys
sys.path.append("..")
from common import *
def parse(d):
return [int(n) for n in d.strip().split(",")]
data = fnl(parse)[0]
school = data
print(data)
days = 256
rate = 7
track = [0 for i in range(rate+2)]
for fish in range(len(school)):
track[school[fish]] += 1
pprint(track)
for day in rang... | 42 | 0 | 23 |
b74ba95ddc10bcbe3857efff4a215ec3fe8911d1 | 503 | py | Python | Scrape&Sum.py | fxie520/Coursera-py4everybody-specialization | e20666e2d07bb9af21689c9acda364936bb68938 | [
"MIT"
] | null | null | null | Scrape&Sum.py | fxie520/Coursera-py4everybody-specialization | e20666e2d07bb9af21689c9acda364936bb68938 | [
"MIT"
] | null | null | null | Scrape&Sum.py | fxie520/Coursera-py4everybody-specialization | e20666e2d07bb9af21689c9acda364936bb68938 | [
"MIT"
] | null | null | null | from urllib.request import urlopen
from bs4 import BeautifulSoup
import ssl
# Ignore SSL certificate errors
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
url = "http://py4e-data.dr-chuck.net/comments_1481945.html"
html = urlopen(url, context=ctx).read().decode()
soup = ... | 25.15 | 59 | 0.735586 | from urllib.request import urlopen
from bs4 import BeautifulSoup
import ssl
# Ignore SSL certificate errors
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
url = "http://py4e-data.dr-chuck.net/comments_1481945.html"
html = urlopen(url, context=ctx).read().decode()
soup = ... | 0 | 0 | 0 |
e1301a6db67dcff08419ca673298c1fb9f4471b4 | 375 | py | Python | roundhouse/contrib/serializers/toml.py | nick-allen/python-roundhouse | 6739fbaf0c5d57802805701848693837a3bdd539 | [
"MIT"
] | null | null | null | roundhouse/contrib/serializers/toml.py | nick-allen/python-roundhouse | 6739fbaf0c5d57802805701848693837a3bdd539 | [
"MIT"
] | null | null | null | roundhouse/contrib/serializers/toml.py | nick-allen/python-roundhouse | 6739fbaf0c5d57802805701848693837a3bdd539 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
import toml
from roundhouse import Serializer
| 18.75 | 56 | 0.68 | from __future__ import absolute_import
import toml
from roundhouse import Serializer
class TOMLSerializer(Serializer):
format = 'toml'
extensions = ['.toml']
def serialize(self, data, stream):
stream.write(toml.dumps(data).encode())
return stream
def deserialize(self, stream):
... | 150 | 114 | 23 |
b7a8c1c8ec978d97439c01dcd896e70376a29ddc | 11,641 | py | Python | wip/da-dmn-analysis.py | CANNlab/epitome | ba8b4831c87f008170f4e9e27a8a946e49fcff54 | [
"Apache-2.0"
] | null | null | null | wip/da-dmn-analysis.py | CANNlab/epitome | ba8b4831c87f008170f4e9e27a8a946e49fcff54 | [
"Apache-2.0"
] | null | null | null | wip/da-dmn-analysis.py | CANNlab/epitome | ba8b4831c87f008170f4e9e27a8a946e49fcff54 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import numpy as np
import epitome as epi
def slidewin_intranet_corr(data, idx, net, n_steps, win_step, win_len):
"""
data -- voxels x timepoints
idx -- voxel network labels (integers)
net -- interger value representing network of interest
n_steps -- number of windows to take
... | 35.169184 | 140 | 0.58397 | #!/usr/bin/env python
import numpy as np
import epitome as epi
def slidewin_intranet_corr(data, idx, net, n_steps, win_step, win_len):
"""
data -- voxels x timepoints
idx -- voxel network labels (integers)
net -- interger value representing network of interest
n_steps -- number of windows to take
... | 7,059 | 0 | 46 |
2b60fd25fc7d2f2503866bee9497078f5b3b172b | 1,992 | py | Python | readthedocs/organizations/managers.py | NiklasTyra/readthedocs.org | c561a68fbdd1de6ac46d2c15bd652862f3219550 | [
"MIT"
] | 1 | 2021-06-25T01:18:19.000Z | 2021-06-25T01:18:19.000Z | readthedocs/organizations/managers.py | NiklasTyra/readthedocs.org | c561a68fbdd1de6ac46d2c15bd652862f3219550 | [
"MIT"
] | 4 | 2021-06-05T00:10:33.000Z | 2022-01-13T03:44:34.000Z | readthedocs/organizations/managers.py | NiklasTyra/readthedocs.org | c561a68fbdd1de6ac46d2c15bd652862f3219550 | [
"MIT"
] | null | null | null | """Organizations managers."""
from django.db import models
from readthedocs.core.utils.extend import SettingsOverrideObject
from .constants import ADMIN_ACCESS, READ_ONLY_ACCESS
class TeamManagerBase(models.Manager):
"""Manager to control team's access."""
class TeamMemberManager(models.Manager):
"""M... | 26.210526 | 76 | 0.606928 | """Organizations managers."""
from django.db import models
from readthedocs.core.utils.extend import SettingsOverrideObject
from .constants import ADMIN_ACCESS, READ_ONLY_ACCESS
class TeamManagerBase(models.Manager):
"""Manager to control team's access."""
def teams_for_user(self, user, organization, adm... | 1,093 | 58 | 104 |
727be4478268d59d5a2bcba490441b043083eed2 | 1,254 | py | Python | up_skdecide/test/test_skdecide_planner.py | aiplan4eu/up-skdecide | 37f4468a5d30677da3e79c8a9aba662337caf2b9 | [
"Apache-2.0"
] | null | null | null | up_skdecide/test/test_skdecide_planner.py | aiplan4eu/up-skdecide | 37f4468a5d30677da3e79c8a9aba662337caf2b9 | [
"Apache-2.0"
] | 1 | 2022-03-30T10:13:33.000Z | 2022-03-30T16:36:17.000Z | up_skdecide/test/test_skdecide_planner.py | aiplan4eu/skdecide-upf | 37f4468a5d30677da3e79c8a9aba662337caf2b9 | [
"Apache-2.0"
] | null | null | null | import unified_planning
from unified_planning.shortcuts import *
from unified_planning.test import TestCase, main, skipIfEngineNotAvailable
from unified_planning.test.examples import get_example_problems
from up_skdecide.domain import DomainImpl as SkDecideDomain
from skdecide.hub.solver.iw import IW
| 33.891892 | 81 | 0.654705 | import unified_planning
from unified_planning.shortcuts import *
from unified_planning.test import TestCase, main, skipIfEngineNotAvailable
from unified_planning.test.examples import get_example_problems
from up_skdecide.domain import DomainImpl as SkDecideDomain
from skdecide.hub.solver.iw import IW
class TestSkDe... | 831 | 15 | 103 |
c1cac74dfc3a9b1c44689663e40a570ec5805b07 | 422 | py | Python | aliyun/api/rest/Slb20140515DescribeLoadBalancerHTTPSListenerAttributeRequest.py | snowyxx/aliyun-python-demo | ed40887ddff440b85b77f9b2a1fcda11cca55c8b | [
"Apache-2.0"
] | null | null | null | aliyun/api/rest/Slb20140515DescribeLoadBalancerHTTPSListenerAttributeRequest.py | snowyxx/aliyun-python-demo | ed40887ddff440b85b77f9b2a1fcda11cca55c8b | [
"Apache-2.0"
] | null | null | null | aliyun/api/rest/Slb20140515DescribeLoadBalancerHTTPSListenerAttributeRequest.py | snowyxx/aliyun-python-demo | ed40887ddff440b85b77f9b2a1fcda11cca55c8b | [
"Apache-2.0"
] | null | null | null | '''
Created by auto_sdk on 2015.01.28
'''
from aliyun.api.base import RestApi
| 32.461538 | 82 | 0.777251 | '''
Created by auto_sdk on 2015.01.28
'''
from aliyun.api.base import RestApi
class Slb20140515DescribeLoadBalancerHTTPSListenerAttributeRequest(RestApi):
def __init__(self,domain='slb.aliyuncs.com',port=80):
RestApi.__init__(self,domain, port)
self.ListenerPort = None
self.LoadBalancerId = None
def ... | 212 | 55 | 73 |
4c976d7e71935899c09afdb2d9652537c33d1a1e | 2,056 | py | Python | rosidl_cli/rosidl_cli/command/generate/extensions.py | iuhilnehc-ynos/rosidl | f0b42cfe83b4c2e731023885b4da4ee7c025c0df | [
"Apache-2.0"
] | null | null | null | rosidl_cli/rosidl_cli/command/generate/extensions.py | iuhilnehc-ynos/rosidl | f0b42cfe83b4c2e731023885b4da4ee7c025c0df | [
"Apache-2.0"
] | 1 | 2021-03-16T02:33:22.000Z | 2021-03-16T02:33:22.000Z | rosidl_cli/rosidl_cli/command/generate/extensions.py | iuhilnehc-ynos/rosidl | f0b42cfe83b4c2e731023885b4da4ee7c025c0df | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 35.448276 | 90 | 0.724222 | # Copyright 2021 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 0 | 0 | 0 |
ee83c4eb3749bad74f63fd196ba0351d9b127ede | 1,410 | py | Python | dm_control/mjcf/skin_test.py | h8907283/dm_control | fe4449606742a7b8bec81930790b98244cddc538 | [
"Apache-2.0"
] | 2,863 | 2018-01-03T01:38:52.000Z | 2022-03-30T09:49:50.000Z | dm_control/mjcf/skin_test.py | krakhit/dm_control | 4e1a35595124742015ae0c7a829e099a5aa100f5 | [
"Apache-2.0"
] | 266 | 2018-01-03T16:00:04.000Z | 2022-03-26T15:45:48.000Z | dm_control/mjcf/skin_test.py | krakhit/dm_control | 4e1a35595124742015ae0c7a829e099a5aa100f5 | [
"Apache-2.0"
] | 580 | 2018-01-03T03:17:27.000Z | 2022-03-31T19:29:32.000Z | # Copyright 2020 The dm_control 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 i... | 30.652174 | 78 | 0.722695 | # Copyright 2020 The dm_control 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 i... | 290 | 11 | 96 |
36346791d88912db48de8c00963e7c8259784d26 | 118 | py | Python | lib_pypy/_ctypes/dummy.py | nanjekyejoannah/pypy | e80079fe13c29eda7b2a6b4cd4557051f975a2d9 | [
"Apache-2.0",
"OpenSSL"
] | 381 | 2018-08-18T03:37:22.000Z | 2022-02-06T23:57:36.000Z | lib_pypy/_ctypes/dummy.py | nanjekyejoannah/pypy | e80079fe13c29eda7b2a6b4cd4557051f975a2d9 | [
"Apache-2.0",
"OpenSSL"
] | 16 | 2018-09-22T18:12:47.000Z | 2022-02-22T20:03:59.000Z | lib_pypy/_ctypes/dummy.py | nanjekyejoannah/pypy | e80079fe13c29eda7b2a6b4cd4557051f975a2d9 | [
"Apache-2.0",
"OpenSSL"
] | 55 | 2015-08-16T02:41:30.000Z | 2022-03-20T20:33:35.000Z |
resize = dummyfunc
| 19.666667 | 64 | 0.754237 | def dummyfunc(*args, **kwargs):
raise NotImplementedError("non-implemented ctypes function")
resize = dummyfunc
| 75 | 0 | 22 |
625ef6fdd5771725491ab68a02179e0c1d073be3 | 1,295 | py | Python | tools/mo/unit_tests/mo/utils/summarize_graph_test.py | pazamelin/openvino | b7e8ef910d7ed8e52326d14dc6fd53b71d16ed48 | [
"Apache-2.0"
] | 1 | 2021-04-20T08:14:51.000Z | 2021-04-20T08:14:51.000Z | tools/mo/unit_tests/mo/utils/summarize_graph_test.py | pazamelin/openvino | b7e8ef910d7ed8e52326d14dc6fd53b71d16ed48 | [
"Apache-2.0"
] | 58 | 2020-11-06T12:13:45.000Z | 2022-03-28T13:20:11.000Z | tools/mo/unit_tests/mo/utils/summarize_graph_test.py | pazamelin/openvino | b7e8ef910d7ed8e52326d14dc6fd53b71d16ed48 | [
"Apache-2.0"
] | 2 | 2019-09-20T01:33:37.000Z | 2019-09-20T08:42:11.000Z | # Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import unittest
from unittest.mock import patch, mock_open
from openvino.tools.mo.front.tf.loader import load_tf_graph_def
from openvino.tools.mo.utils.summarize_graph import summarize_graph
pbtxt = 'node{name:"Placeholder"op:"Placehol... | 49.807692 | 121 | 0.688031 | # Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import unittest
from unittest.mock import patch, mock_open
from openvino.tools.mo.front.tf.loader import load_tf_graph_def
from openvino.tools.mo.utils.summarize_graph import summarize_graph
pbtxt = 'node{name:"Placeholder"op:"Placehol... | 653 | 26 | 49 |
5908fb762191a70522748c2baac23a20f269187f | 312 | py | Python | Competitions/Codechef/LTIME50/MAXOR.py | cnm06/Competitive-Programming | 94242ae458570d503b8218f37624b88cc5020d23 | [
"MIT"
] | 994 | 2017-02-28T06:13:47.000Z | 2022-03-31T10:49:00.000Z | Competitions/Codechef/LTIME50/MAXOR.py | Quadrified/Competitive-Programming | bccb69952cc5260fb3647b3301ddac1023dacac8 | [
"MIT"
] | 16 | 2018-01-01T02:59:55.000Z | 2021-11-22T12:49:16.000Z | Competitions/Codechef/LTIME50/MAXOR.py | Quadrified/Competitive-Programming | bccb69952cc5260fb3647b3301ddac1023dacac8 | [
"MIT"
] | 325 | 2017-06-15T03:32:43.000Z | 2022-03-28T22:43:42.000Z | t = int(raw_input().strip())
for i in xrange(t):
n = int(raw_input().strip())
data = [int(j) for j in raw_input().strip().split()]
ans = 0
for j in xrange(n - 1):
for k in xrange(j + 1, n):
if data[j] | data[k] <= max(data[j], data[k]):
ans += 1
print ans
| 28.363636 | 58 | 0.487179 | t = int(raw_input().strip())
for i in xrange(t):
n = int(raw_input().strip())
data = [int(j) for j in raw_input().strip().split()]
ans = 0
for j in xrange(n - 1):
for k in xrange(j + 1, n):
if data[j] | data[k] <= max(data[j], data[k]):
ans += 1
print ans
| 0 | 0 | 0 |
eaa0734620065fe0d364268b18d5ef98ed86ef52 | 7,687 | py | Python | tests/test_imageprojection.py | s1duan/SmoothParticleNets | 826cb25396b59435dc95df5a119d2b349fcfbd4f | [
"MIT"
] | 45 | 2018-05-07T16:56:44.000Z | 2022-03-20T02:52:39.000Z | tests/test_imageprojection.py | s1duan/SmoothParticleNets | 826cb25396b59435dc95df5a119d2b349fcfbd4f | [
"MIT"
] | 1 | 2021-09-27T21:10:33.000Z | 2021-10-03T22:11:40.000Z | tests/test_imageprojection.py | s1duan/SmoothParticleNets | 826cb25396b59435dc95df5a119d2b349fcfbd4f | [
"MIT"
] | 17 | 2018-07-26T20:22:26.000Z | 2021-12-07T03:46:38.000Z | import os
import sys
# Add path to python source to path.
sys.path.append(os.path.join(os.path.dirname(
os.path.dirname(os.path.abspath(__file__))), "python"))
import SmoothParticleNets as spn
import itertools
import numpy as np
import torch
import torch.autograd
from gradcheck import gradcheck
from test_convsdf ... | 37.315534 | 128 | 0.584493 | import os
import sys
# Add path to python source to path.
sys.path.append(os.path.join(os.path.dirname(
os.path.dirname(os.path.abspath(__file__))), "python"))
import SmoothParticleNets as spn
import itertools
import numpy as np
import torch
import torch.autograd
from gradcheck import gradcheck
from test_convsdf ... | 6,507 | 0 | 115 |
f6c03d2c5a2d32ef6ce7eaef03a2a7691daf33a2 | 300 | py | Python | day2_1.py | defectedWBC/AoC | a3e6e05eff86cbeb8dea99c4b9b497282f35c7f7 | [
"MIT"
] | null | null | null | day2_1.py | defectedWBC/AoC | a3e6e05eff86cbeb8dea99c4b9b497282f35c7f7 | [
"MIT"
] | null | null | null | day2_1.py | defectedWBC/AoC | a3e6e05eff86cbeb8dea99c4b9b497282f35c7f7 | [
"MIT"
] | null | null | null | data=open('input2.txt',"r")
la=list()
h,d=0,0
for x in data:
la.append(x.strip().split())
for i in range(len(la)):
if la[i][0]=='forward':
h+=int(la[i][1])
elif la[i][0]=='down':
d+=int(la[i][1])
elif la[i][0]=='up':
d-=int(la[i][1])
print(h*d)
| 20 | 33 | 0.463333 | data=open('input2.txt',"r")
la=list()
h,d=0,0
for x in data:
la.append(x.strip().split())
for i in range(len(la)):
if la[i][0]=='forward':
h+=int(la[i][1])
elif la[i][0]=='down':
d+=int(la[i][1])
elif la[i][0]=='up':
d-=int(la[i][1])
print(h*d)
| 0 | 0 | 0 |
1e2c392a91587264af9830cc82659e4dcfc073e0 | 4,505 | py | Python | examples/ex6_multiprocessing.py | vallen-systems/pyVallenAE | 0e1c712c055ea5c4e7cb4373a2bf73f33c2b886d | [
"MIT"
] | 10 | 2020-01-30T15:34:51.000Z | 2022-03-11T07:49:31.000Z | examples/ex6_multiprocessing.py | vallen-systems/pyVallenAE | 0e1c712c055ea5c4e7cb4373a2bf73f33c2b886d | [
"MIT"
] | 1 | 2020-10-30T16:25:11.000Z | 2020-11-05T19:51:51.000Z | examples/ex6_multiprocessing.py | vallen-systems/pyVallenAE | 0e1c712c055ea5c4e7cb4373a2bf73f33c2b886d | [
"MIT"
] | 5 | 2020-02-08T04:43:03.000Z | 2022-02-23T13:52:00.000Z | """
Go fast with multiprocessing
============================
The streaming interfaces with iterables allow efficient batch processing as shown :doc:`here <ex4_timepicker_batch>`.
But still only one core/thread will be utilized. We will change that will multiprocessing.
Following example shows a batch feature extract... | 37.541667 | 120 | 0.722531 | """
Go fast with multiprocessing
============================
The streaming interfaces with iterables allow efficient batch processing as shown :doc:`here <ex4_timepicker_batch>`.
But still only one core/thread will be utilized. We will change that will multiprocessing.
Following example shows a batch feature extract... | 338 | 0 | 44 |
e826917f2d28f05bb890797412dd67440c0d2bfa | 7,870 | py | Python | machine_learning_with_python/ml_logger/__init__.py | universityofprofessorex/machine-learning-with-python | 88cf5951ccb6ef4ee7a6e0f818b67bb82984aff8 | [
"Apache-2.0"
] | null | null | null | machine_learning_with_python/ml_logger/__init__.py | universityofprofessorex/machine-learning-with-python | 88cf5951ccb6ef4ee7a6e0f818b67bb82984aff8 | [
"Apache-2.0"
] | null | null | null | machine_learning_with_python/ml_logger/__init__.py | universityofprofessorex/machine-learning-with-python | 88cf5951ccb6ef4ee7a6e0f818b67bb82984aff8 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import collections
try: # python 3
from collections import abc
except ImportError: # python 2
import collections as abc
import concurrent.futures
from datetime import datetime
import gc
import inspect
import logging
from logging import Logger, LogRecord
import os
# import slack
impor... | 30.503876 | 108 | 0.650064 | #!/usr/bin/env python3
import collections
try: # python 3
from collections import abc
except ImportError: # python 2
import collections as abc
import concurrent.futures
from datetime import datetime
import gc
import inspect
import logging
from logging import Logger, LogRecord
import os
# import slack
impor... | 5,575 | 0 | 249 |
5aba823208424a96fa512fc72bb36d20476152c7 | 3,647 | py | Python | schedules/admin.py | dvek/scyp | 0f70d6a9071edbf9e26b7cb3cfaea38905e192d1 | [
"MIT"
] | null | null | null | schedules/admin.py | dvek/scyp | 0f70d6a9071edbf9e26b7cb3cfaea38905e192d1 | [
"MIT"
] | 4 | 2020-06-05T18:27:22.000Z | 2021-09-07T23:55:27.000Z | schedules/admin.py | dvek/scyp | 0f70d6a9071edbf9e26b7cb3cfaea38905e192d1 | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.utils import timezone
from django.utils.safestring import mark_safe
from django.urls import reverse
from .calendar import EventCalendar
import datetime, calendar
from .models import (
TimeOfDay,
Scheduler,
SchedulerException,
SchedulerRecurringPattern,
Ac... | 36.108911 | 118 | 0.697834 | from django.contrib import admin
from django.utils import timezone
from django.utils.safestring import mark_safe
from django.urls import reverse
from .calendar import EventCalendar
import datetime, calendar
from .models import (
TimeOfDay,
Scheduler,
SchedulerException,
SchedulerRecurringPattern,
Ac... | 1,999 | 511 | 133 |
1c89478eb6e0f5022b8618d2c23bd832508c0189 | 21,194 | py | Python | tensorflow/python/ops/ragged/ragged_tensor_supported_values_test.py | Saduf2019/tensorflow-1 | d36aab4a474da352accfca38edb5d0f1c584ed9b | [
"Apache-2.0"
] | 7 | 2022-03-04T21:14:47.000Z | 2022-03-22T23:07:39.000Z | tensorflow/python/ops/ragged/ragged_tensor_supported_values_test.py | Martaw-code/tensorflow | f210b2b2f8489ffe97edac886238242288950439 | [
"Apache-2.0"
] | 1 | 2020-08-01T05:40:12.000Z | 2020-08-01T05:40:12.000Z | tensorflow/python/ops/ragged/ragged_tensor_supported_values_test.py | Martaw-code/tensorflow | f210b2b2f8489ffe97edac886238242288950439 | [
"Apache-2.0"
] | 1 | 2022-03-22T00:45:15.000Z | 2022-03-22T00:45:15.000Z | # Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 38.745887 | 80 | 0.631216 | # Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 11,378 | 6,773 | 314 |
4d06e06d3b0546d2ce7ff7869d65f61884e9a360 | 2,179 | py | Python | Deduplicator.py | SilkSlime/deduplicator | 0d58cb6d78cca48f1304b75c7f30c2f022675f9a | [
"MIT"
] | null | null | null | Deduplicator.py | SilkSlime/deduplicator | 0d58cb6d78cca48f1304b75c7f30c2f022675f9a | [
"MIT"
] | null | null | null | Deduplicator.py | SilkSlime/deduplicator | 0d58cb6d78cca48f1304b75c7f30c2f022675f9a | [
"MIT"
] | null | null | null | import os
import hashlib
| 36.316667 | 89 | 0.56402 | import os
import hashlib
class Deduplicator:
def find_duplication_groups_by_hash(filenames):
sizes = []
hashes = []
print("Calculating sizes...")
for i, filename in enumerate(filenames):
print(" [{}/{}] ".format(i+1, len(filenames)), end='\r')
siz... | 2,051 | -2 | 104 |
6b7685d1f7f0a2ef9a60770efcfeada79a6d0709 | 365 | gyp | Python | gyp/poppler.gyp | quanganh2627/bytm-x64-L-w05-2015_external_chromium_org_third_party_skia | 90b3f9b82dbad266f960601d2120082bb841fb97 | [
"BSD-3-Clause"
] | 111 | 2015-01-13T22:01:50.000Z | 2021-06-10T15:32:48.000Z | gyp/poppler.gyp | quanganh2627/bytm-x64-L-w05-2015_external_chromium_org_third_party_skia | 90b3f9b82dbad266f960601d2120082bb841fb97 | [
"BSD-3-Clause"
] | 129 | 2015-01-14T16:07:02.000Z | 2020-03-11T19:44:42.000Z | gyp/poppler.gyp | quanganh2627/bytm-x64-L-w05-2015_external_chromium_org_third_party_skia | 90b3f9b82dbad266f960601d2120082bb841fb97 | [
"BSD-3-Clause"
] | 64 | 2015-01-14T16:45:39.000Z | 2021-09-08T11:16:05.000Z | # Poppler, assuming it's been installed to the (Linux) system.
{
'targets': [{
'target_name': 'poppler',
'type': 'none',
'direct_dependent_settings': {
'libraries': [
'-lpoppler-cpp',
],
'include_dirs': [
'/usr/include/poppl... | 22.8125 | 62 | 0.430137 | # Poppler, assuming it's been installed to the (Linux) system.
{
'targets': [{
'target_name': 'poppler',
'type': 'none',
'direct_dependent_settings': {
'libraries': [
'-lpoppler-cpp',
],
'include_dirs': [
'/usr/include/poppl... | 0 | 0 | 0 |
e2b22a59ede97a69b5816e1b1c3c9a15b69a71c2 | 32 | py | Python | starry_process/app/main.py | arfon/starry_process | 72b2a540e7e4fdb2e6af61507efa1c9861d5c919 | [
"MIT"
] | 13 | 2020-04-14T17:47:28.000Z | 2022-03-16T15:19:48.000Z | starry_process/app/main.py | arfon/starry_process | 72b2a540e7e4fdb2e6af61507efa1c9861d5c919 | [
"MIT"
] | 22 | 2020-09-23T20:33:22.000Z | 2022-02-07T17:38:09.000Z | starry_process/app/main.py | arfon/starry_process | 72b2a540e7e4fdb2e6af61507efa1c9861d5c919 | [
"MIT"
] | 8 | 2020-04-14T17:47:44.000Z | 2022-02-06T16:39:47.000Z | from .app import app
app.run()
| 8 | 20 | 0.6875 | from .app import app
app.run()
| 0 | 0 | 0 |
01db618c67b3a3d5a5a870922243d951a69c6806 | 3,151 | py | Python | N-ROD/evrepr/data/dat_reader.py | DA4EVENT/home | 18cc93a795ce132e05b886aa34565a102915b1c6 | [
"MIT"
] | 5 | 2021-11-19T23:32:27.000Z | 2022-01-17T13:40:00.000Z | N-ROD/evrepr/data/dat_reader.py | Chiaraplizz/home | 18cc93a795ce132e05b886aa34565a102915b1c6 | [
"MIT"
] | 1 | 2022-01-17T13:41:57.000Z | 2022-01-17T13:46:00.000Z | N-ROD/evrepr/data/dat_reader.py | Chiaraplizz/home | 18cc93a795ce132e05b886aa34565a102915b1c6 | [
"MIT"
] | 1 | 2021-11-27T11:48:49.000Z | 2021-11-27T11:48:49.000Z | import os
import numpy as np
from numba import njit
from evrepr.data.file_reader import FileReader
@njit
| 33.88172 | 75 | 0.505871 | import os
import numpy as np
from numba import njit
from evrepr.data.file_reader import FileReader
@njit
def _overflow_idx(array, ovf_th):
prev = 0
for idx, val in np.ndenumerate(array):
if idx[0] > 0 and int(prev) - int(val) > ovf_th:
return idx[0]
prev = val
return -1
clas... | 2,918 | 78 | 45 |
a7d7c475d9a5e9374253d72ef6f2d4dc3f1c325a | 8,619 | py | Python | src/super_gradients/training/models/classification_models/vit.py | Deci-AI/super-gradients | 658f638389654668a085e23c3b19622241fd9267 | [
"Apache-2.0"
] | 308 | 2021-12-30T10:14:30.000Z | 2022-03-30T19:05:31.000Z | src/super_gradients/training/models/classification_models/vit.py | Deci-AI/super-gradients | 658f638389654668a085e23c3b19622241fd9267 | [
"Apache-2.0"
] | 24 | 2022-01-10T08:05:37.000Z | 2022-03-30T18:49:06.000Z | src/super_gradients/training/models/classification_models/vit.py | Deci-AI/super-gradients | 658f638389654668a085e23c3b19622241fd9267 | [
"Apache-2.0"
] | 26 | 2021-12-31T06:04:07.000Z | 2022-03-21T09:51:44.000Z | """Vision Transformer in PyTorch.
Reference:
[1] Dosovitskiy, Alexey, et al. "An image is worth 16x16 words: Transformers for image recognition at scale."
arXiv preprint arXiv:2010.11929 (2020)
Code adapted from https://github.com/lucidrains/vit-pytorch/blob/main/vit_pytorch/vit.py
"""
import torch
from torch import ... | 40.275701 | 139 | 0.647175 | """Vision Transformer in PyTorch.
Reference:
[1] Dosovitskiy, Alexey, et al. "An image is worth 16x16 words: Transformers for image recognition at scale."
arXiv preprint arXiv:2010.11929 (2020)
Code adapted from https://github.com/lucidrains/vit-pytorch/blob/main/vit_pytorch/vit.py
"""
import torch
from torch import ... | 5,296 | 2,135 | 403 |
6971d3b74839ca2544c039e1d67dd38c5bb3d013 | 106,237 | py | Python | pysprint.py | salem-ok/PySprint | 2d98adb826ca8a7ede4cdf1b8a5d9b1821034694 | [
"CC0-1.0"
] | 21 | 2021-02-28T13:03:17.000Z | 2022-02-23T05:21:11.000Z | pysprint.py | salem-ok/PySprint | 2d98adb826ca8a7ede4cdf1b8a5d9b1821034694 | [
"CC0-1.0"
] | 72 | 2021-02-28T09:12:02.000Z | 2021-12-16T08:04:20.000Z | pysprint.py | salem-ok/PySprint | 2d98adb826ca8a7ede4cdf1b8a5d9b1821034694 | [
"CC0-1.0"
] | 2 | 2021-11-28T21:44:04.000Z | 2021-12-06T09:09:17.000Z | import pygame
import pygame.display
import pygame.mixer
from pygame import gfxdraw
import numpy as np
import pysprint_car
import pysprint_tracks
import random
import json
import os
#New awesome imports from shazz :D
from managers.sample_manager import SampleManager
from managers.texture_manager import TextureManager
f... | 49.024919 | 314 | 0.557979 | import pygame
import pygame.display
import pygame.mixer
from pygame import gfxdraw
import numpy as np
import pysprint_car
import pysprint_tracks
import random
import json
import os
#New awesome imports from shazz :D
from managers.sample_manager import SampleManager
from managers.texture_manager import TextureManager
f... | 91,751 | 0 | 667 |
d9a50a86a382375350c4f6f9e22446c69dc70630 | 35,256 | py | Python | ThirdParty/Twisted/vtkTwisted/src/twisted/web/static.py | inviCRO/VTK | a2dc2e79d4ecb8f6da900535b32e1a2a702c7f48 | [
"BSD-3-Clause"
] | 9 | 2017-07-10T04:27:31.000Z | 2020-07-31T08:54:08.000Z | ThirdParty/Twisted/vtkTwisted/src/twisted/web/static.py | inviCRO/VTK | a2dc2e79d4ecb8f6da900535b32e1a2a702c7f48 | [
"BSD-3-Clause"
] | 14 | 2015-04-25T17:54:13.000Z | 2017-01-13T15:30:39.000Z | ThirdParty/Twisted/vtkTwisted/src/twisted/web/static.py | inviCRO/VTK | a2dc2e79d4ecb8f6da900535b32e1a2a702c7f48 | [
"BSD-3-Clause"
] | 4 | 2017-09-11T02:26:21.000Z | 2021-12-31T05:20:34.000Z | # -*- test-case-name: twisted.web.test.test_static -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Static resources for L{twisted.web}.
"""
from __future__ import division, absolute_import
import os
import warnings
import itertools
import time
import errno
import mimetypes
from zope.... | 34.063768 | 129 | 0.605259 | # -*- test-case-name: twisted.web.test.test_static -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Static resources for L{twisted.web}.
"""
from __future__ import division, absolute_import
import os
import warnings
import itertools
import time
import errno
import mimetypes
from zope.... | 5,277 | 13 | 743 |
fc8d8ce82f46eb97e2ec76dd64bf9eb116b7f953 | 5,122 | py | Python | pyrcn/datasets/_base.py | TUD-STKS/PyRCN | 26fb7f0d55e8c8925f692191c56db2ea32e3f630 | [
"BSD-3-Clause"
] | 35 | 2020-07-21T18:11:01.000Z | 2022-03-28T01:31:11.000Z | pyrcn/datasets/_base.py | TUD-STKS/PyRCN | 26fb7f0d55e8c8925f692191c56db2ea32e3f630 | [
"BSD-3-Clause"
] | 21 | 2020-12-30T14:25:26.000Z | 2021-12-02T10:34:43.000Z | pyrcn/datasets/_base.py | TUD-STKS/PyRCN | 26fb7f0d55e8c8925f692191c56db2ea32e3f630 | [
"BSD-3-Clause"
] | 10 | 2020-07-15T11:22:21.000Z | 2022-03-18T10:27:47.000Z | import collections
from typing import Union
import numpy as np
from sklearn.utils.validation import _deprecate_positional_args
from sklearn.datasets import load_digits as sklearn_load_digits
def _mg_eq(xt, xtau, a=0.2, b=0.1, n=10):
"""
Mackey-Glass time delay diffential equation, at values x(t) and x(t-tau).... | 36.070423 | 101 | 0.591566 | import collections
from typing import Union
import numpy as np
from sklearn.utils.validation import _deprecate_positional_args
from sklearn.datasets import load_digits as sklearn_load_digits
def _mg_eq(xt, xtau, a=0.2, b=0.1, n=10):
"""
Mackey-Glass time delay diffential equation, at values x(t) and x(t-tau).... | 617 | 0 | 22 |
0a4d4e404d3a925ce31de8bda0927ce0045d9cf2 | 385 | py | Python | server/core.py | dsjen/gobo | 239e4a5226c3f643d615f264e81b602a0b3aab01 | [
"MIT"
] | 90 | 2017-11-17T05:43:42.000Z | 2022-02-21T17:10:20.000Z | server/core.py | dsjen/gobo | 239e4a5226c3f643d615f264e81b602a0b3aab01 | [
"MIT"
] | 112 | 2017-11-28T22:56:32.000Z | 2022-03-08T23:39:14.000Z | server/core.py | dsjen/gobo | 239e4a5226c3f643d615f264e81b602a0b3aab01 | [
"MIT"
] | 18 | 2017-12-18T21:06:19.000Z | 2022-01-01T16:13:30.000Z | from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager
from flask_bcrypt import Bcrypt
from flask_mail import Mail
from flask_migrate import Migrate
#: Flask-SQLAlchemy extension instance
db = SQLAlchemy()
#: Flask-Bcrypt extension instance
bcrypt = Bcrypt()
#: Flask-Login extension instance
lo... | 20.263158 | 39 | 0.802597 | from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager
from flask_bcrypt import Bcrypt
from flask_mail import Mail
from flask_migrate import Migrate
#: Flask-SQLAlchemy extension instance
db = SQLAlchemy()
#: Flask-Bcrypt extension instance
bcrypt = Bcrypt()
#: Flask-Login extension instance
lo... | 0 | 0 | 0 |
b142ebfa9e998a454acddbfc0be68cc849b5485d | 3,319 | py | Python | cfntools/ls.py | boroivanov/cfn-tools | 1761d509801a6fe4dd826c857df286e75160d5be | [
"MIT"
] | 4 | 2017-02-10T17:25:12.000Z | 2021-03-12T15:06:54.000Z | cfntools/ls.py | boroivanov/cfn-tools | 1761d509801a6fe4dd826c857df286e75160d5be | [
"MIT"
] | 1 | 2019-05-27T19:16:01.000Z | 2019-05-28T06:54:19.000Z | cfntools/ls.py | boroivanov/cfn-tools | 1761d509801a6fe4dd826c857df286e75160d5be | [
"MIT"
] | null | null | null | import sys
import boto3
import click
from botocore.exceptions import ClientError
status_map = {
'CREATE_IN_PROGRESS': 'CP',
'CREATE_FAILED': 'CF',
'CREATE_COMPLETE': 'C',
'ROLLBACK_IN_PROGRESS': 'RP',
'ROLLBACK_FAILED': 'RF',
'ROLLBACK_COMPLETE': 'R',
'DELETE_IN_PROGRESS': 'DP',
'DELE... | 31.018692 | 99 | 0.637541 | import sys
import boto3
import click
from botocore.exceptions import ClientError
status_map = {
'CREATE_IN_PROGRESS': 'CP',
'CREATE_FAILED': 'CF',
'CREATE_COMPLETE': 'C',
'ROLLBACK_IN_PROGRESS': 'RP',
'ROLLBACK_FAILED': 'RF',
'ROLLBACK_COMPLETE': 'R',
'DELETE_IN_PROGRESS': 'DP',
'DELE... | 348 | 0 | 46 |
de3635b6ab5e5976733670b2cbe8dd178751d97b | 3,837 | py | Python | main.py | venicegeo/pz-servicemonitor | 1b56ca3348306b188e409bfb03b92e4c1774dab1 | [
"Apache-2.0"
] | null | null | null | main.py | venicegeo/pz-servicemonitor | 1b56ca3348306b188e409bfb03b92e4c1774dab1 | [
"Apache-2.0"
] | null | null | null | main.py | venicegeo/pz-servicemonitor | 1b56ca3348306b188e409bfb03b92e4c1774dab1 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2016, RadsiantBlue Technologies, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | 30.212598 | 100 | 0.627313 | # -*- coding: utf-8 -*-
# Copyright 2016, RadsiantBlue Technologies, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | 2,243 | 156 | 235 |
81e97f1a21c85baf8a064fab980cd8baf696ae78 | 1,757 | py | Python | tests/unit/test_configurations.py | LimaGuilherme/what-is-your-band-favorite-word-api | dff4a9ed120bdd9dca1ad72167aa963d15d810ca | [
"MIT"
] | null | null | null | tests/unit/test_configurations.py | LimaGuilherme/what-is-your-band-favorite-word-api | dff4a9ed120bdd9dca1ad72167aa963d15d810ca | [
"MIT"
] | null | null | null | tests/unit/test_configurations.py | LimaGuilherme/what-is-your-band-favorite-word-api | dff4a9ed120bdd9dca1ad72167aa963d15d810ca | [
"MIT"
] | null | null | null | from unittest import TestCase
from src.configurations import SimpleConfig, FullConfig
| 39.931818 | 75 | 0.697211 | from unittest import TestCase
from src.configurations import SimpleConfig, FullConfig
class TestSimpleConfig(TestCase):
def test_should_init(self):
simple_config = SimpleConfig(
SPOTIFY_CLIENT_ID='fdsafsad',
SPOTIFY_CLIENT_SECRET='FDSJOIdsja',
GENIUS_ACCESS_TOKEN='aoi... | 1,546 | 22 | 100 |
f26c48e2f174e4c2dc2fa5f37957dc2e0036fdc6 | 23 | py | Python | kusanagi/shell/arduino/__init__.py | tsetimmy/kusanagi | 868b301b6064af7d21f0f716aa4390e402f2e2ec | [
"MIT"
] | 22 | 2018-08-04T04:51:27.000Z | 2021-11-03T14:22:16.000Z | kusanagi/shell/arduino/__init__.py | tsetimmy/kusanagi | 868b301b6064af7d21f0f716aa4390e402f2e2ec | [
"MIT"
] | 1 | 2021-11-16T12:41:14.000Z | 2021-11-16T12:41:14.000Z | kusanagi/shell/arduino/__init__.py | tsetimmy/kusanagi | 868b301b6064af7d21f0f716aa4390e402f2e2ec | [
"MIT"
] | 7 | 2018-08-04T04:51:29.000Z | 2021-07-17T07:26:04.000Z | from .arduino import *
| 11.5 | 22 | 0.73913 | from .arduino import *
| 0 | 0 | 0 |
536958f9f59db879d82fd9fb96e01e32e0a5fdbe | 1,689 | py | Python | ENV/lib/python3.5/site-packages/pyrogram/api/types/sticker_pack.py | block1o1/CryptoPredicted | 7f660cdc456fb8252b3125028f31fd6f5a3ceea5 | [
"MIT"
] | 4 | 2021-10-14T21:22:25.000Z | 2022-03-12T19:58:48.000Z | ENV/lib/python3.5/site-packages/pyrogram/api/types/sticker_pack.py | inevolin/CryptoPredicted | 7f660cdc456fb8252b3125028f31fd6f5a3ceea5 | [
"MIT"
] | null | null | null | ENV/lib/python3.5/site-packages/pyrogram/api/types/sticker_pack.py | inevolin/CryptoPredicted | 7f660cdc456fb8252b3125028f31fd6f5a3ceea5 | [
"MIT"
] | 1 | 2022-03-15T22:52:53.000Z | 2022-03-15T22:52:53.000Z | # Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2018 Dan Tès <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free S... | 28.15 | 74 | 0.648905 | # Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2018 Dan Tès <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free S... | 540 | 0 | 80 |
b49809a379d4e48f43a48301a68e5c684b91883b | 3,488 | py | Python | Densidades (test)/plot_regions.py | PaipaPsyche/SuperClusterCharacterization | 8d86ad31aa34dfa6a44592b94c42cba38487216d | [
"MIT"
] | null | null | null | Densidades (test)/plot_regions.py | PaipaPsyche/SuperClusterCharacterization | 8d86ad31aa34dfa6a44592b94c42cba38487216d | [
"MIT"
] | null | null | null | Densidades (test)/plot_regions.py | PaipaPsyche/SuperClusterCharacterization | 8d86ad31aa34dfa6a44592b94c42cba38487216d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Apr 9 17:41:20 2018
@author: David
"""
import numpy as np
import matplotlib.pyplot as plt
from astropy.convolution import Gaussian2DKernel,convolve
#Data Loading========
data1 = np.loadtxt("Halo.txt")
data1=np.transpose(data1)
prints=0#Define si se hacen los prints de ca... | 22.797386 | 102 | 0.59203 | # -*- coding: utf-8 -*-
"""
Created on Mon Apr 9 17:41:20 2018
@author: David
"""
import numpy as np
import matplotlib.pyplot as plt
from astropy.convolution import Gaussian2DKernel,convolve
#Data Loading========
data1 = np.loadtxt("Halo.txt")
data1=np.transpose(data1)
prints=0#Define si se hacen los prints de ca... | 577 | 0 | 90 |
068f29160b95440373e599647bcd4ab44806dd00 | 120 | py | Python | aula61_30/tupla.py | thidoa/Udemy_python3 | b4d6b922b3d8eb2cfeb06ba4b5b449b168c32818 | [
"Apache-2.0"
] | null | null | null | aula61_30/tupla.py | thidoa/Udemy_python3 | b4d6b922b3d8eb2cfeb06ba4b5b449b168c32818 | [
"Apache-2.0"
] | null | null | null | aula61_30/tupla.py | thidoa/Udemy_python3 | b4d6b922b3d8eb2cfeb06ba4b5b449b168c32818 | [
"Apache-2.0"
] | null | null | null | tupla1 = (1,2,3,4,5)
print(tupla1)
tupla1 = list(tupla1) # Convertendo a tupla para lista
tupla1[1] = 3000
print(tupla1) | 24 | 54 | 0.716667 | tupla1 = (1,2,3,4,5)
print(tupla1)
tupla1 = list(tupla1) # Convertendo a tupla para lista
tupla1[1] = 3000
print(tupla1) | 0 | 0 | 0 |
4dac4e85cd50262423cf7538d2a6fec900223dde | 1,818 | py | Python | core.py | Mrdaigithub/penetration | b6390a8b0ab7315cece9aad78e5cb11697c4b4c8 | [
"MIT"
] | null | null | null | core.py | Mrdaigithub/penetration | b6390a8b0ab7315cece9aad78e5cb11697c4b4c8 | [
"MIT"
] | null | null | null | core.py | Mrdaigithub/penetration | b6390a8b0ab7315cece9aad78e5cb11697c4b4c8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# coding: utf-8
import multiprocessing
from sshconnector import sshconnector
import pymysql
import asyncio
db = pymysql.connect("localhost", "root", "root", "hosts")
| 27.969231 | 112 | 0.60451 | #!/usr/bin/env python3
# coding: utf-8
import multiprocessing
from sshconnector import sshconnector
import pymysql
import asyncio
db = pymysql.connect("localhost", "root", "root", "hosts")
def add_unuse_hosts():
def save_host(host):
cursor = db.cursor()
try:
cursor.execute("INSERT IN... | 1,555 | 0 | 69 |
048a7e9f4718ad3529b2df819e07f17e3efb1c00 | 1,145 | py | Python | jpnance/set1/set1.py | ryanwc/classix-crypto | e65ffb96c8a4d93ed0041357ea2347d38f43abc8 | [
"MIT"
] | null | null | null | jpnance/set1/set1.py | ryanwc/classix-crypto | e65ffb96c8a4d93ed0041357ea2347d38f43abc8 | [
"MIT"
] | null | null | null | jpnance/set1/set1.py | ryanwc/classix-crypto | e65ffb96c8a4d93ed0041357ea2347d38f43abc8 | [
"MIT"
] | 1 | 2020-05-09T22:30:43.000Z | 2020-05-09T22:30:43.000Z | #!/usr/bin/python3
import unittest
if __name__ == '__main__':
unittest.main()
| 31.805556 | 199 | 0.759825 | #!/usr/bin/python3
import unittest
class TestMethods(unittest.TestCase):
def testHexToBase64(self):
self.assertEqual(hexToBase64('49276d206b696c6c696e6720796f757220627261696e206c696b65206120706f69736f6e6f7573206d757368726f6f6d'), 'SSdtIGtpbGxpbmcgeW91ciBicmFpbiBsaWtlIGEgcG9pc29ub3VzIG11c2hyb29t')
def testFixedXo... | 932 | 16 | 116 |
efadc5124197703247d19be16e5cd0d463e29d7b | 385 | py | Python | experiment_scripts/update_traffic.py | Joseph329123/microservices-demo | 3550f4728292536728be04ce36d97c588afa49a3 | [
"Apache-2.0"
] | 10 | 2019-08-21T09:01:36.000Z | 2020-02-14T20:18:43.000Z | experiment_scripts/update_traffic.py | Joseph329123/microservices-demo | 3550f4728292536728be04ce36d97c588afa49a3 | [
"Apache-2.0"
] | 5 | 2021-02-08T20:34:22.000Z | 2022-01-22T08:14:35.000Z | experiment_scripts/update_traffic.py | Joseph329123/microservices-demo | 3550f4728292536728be04ce36d97c588afa49a3 | [
"Apache-2.0"
] | 1 | 2019-09-04T18:02:09.000Z | 2019-09-04T18:02:09.000Z | import sys
import ruamel.yaml as yaml
TRAFFIC = sys.argv[1]
file = "../kubernetes-manifests/loadgenerator.yaml"
with open(file, "r") as stream:
d = list(yaml.safe_load_all(stream))
d[0]['spec']['template']['spec']['containers'][0]['env'][0]['value'] = TRAFFIC
with open(file, "w") as stream:
yaml.dump_all(
... | 21.388889 | 78 | 0.631169 | import sys
import ruamel.yaml as yaml
TRAFFIC = sys.argv[1]
file = "../kubernetes-manifests/loadgenerator.yaml"
with open(file, "r") as stream:
d = list(yaml.safe_load_all(stream))
d[0]['spec']['template']['spec']['containers'][0]['env'][0]['value'] = TRAFFIC
with open(file, "w") as stream:
yaml.dump_all(
... | 0 | 0 | 0 |
d6796b4d4a6e1fbe1771bf035ffe76ccb9de6322 | 568 | py | Python | leetcode/python/easy/p674_findLengthOfLCIS.py | kefirzhang/algorithms | 549e68731d4c05002e35f0499d4f7744f5c63979 | [
"Apache-2.0"
] | null | null | null | leetcode/python/easy/p674_findLengthOfLCIS.py | kefirzhang/algorithms | 549e68731d4c05002e35f0499d4f7744f5c63979 | [
"Apache-2.0"
] | null | null | null | leetcode/python/easy/p674_findLengthOfLCIS.py | kefirzhang/algorithms | 549e68731d4c05002e35f0499d4f7744f5c63979 | [
"Apache-2.0"
] | null | null | null |
slu = Solution()
print(slu.findLengthOfLCIS([1, 3, 5, 4, 7]))
| 28.4 | 62 | 0.526408 | class Solution:
def findLengthOfLCIS(self, nums) -> int:
i, length = 0, len(nums)
if length <= 1:
return length
max_continue, cur_continue = 1, 1
while i < length - 1:
if nums[i] < nums[i + 1]:
cur_continue += 1
else:
... | 462 | -6 | 48 |
0917d7a8936d341a2639fc5dcc46803c52f19b92 | 313 | py | Python | a.py | chivitc1/pygamedemo | e1515ed9b94171a9e61a92ecec9da8cdcbe0efde | [
"MIT"
] | null | null | null | a.py | chivitc1/pygamedemo | e1515ed9b94171a9e61a92ecec9da8cdcbe0efde | [
"MIT"
] | null | null | null | a.py | chivitc1/pygamedemo | e1515ed9b94171a9e61a92ecec9da8cdcbe0efde | [
"MIT"
] | null | null | null |
Spam('Key 1', 'Value 1')
Spam('Key 2', 'Value 2')
| 20.866667 | 36 | 0.549521 | class Spam(object):
def __init__(self, key, value):
self.list_ = [value]
self.dict_ = {key : value}
self.list_.append(value)
self.dict_[key] = value
print(f'List: {self.list_}')
print(f'Dict: {self.dict_}')
Spam('Key 1', 'Value 1')
Spam('Key 2', 'Value 2')
| 215 | -2 | 49 |
596c314ccfcb410f87d9b17577b69909a1407f1b | 258 | py | Python | app/crud/notification/BroadcastReadDao.py | cdlaimin/pity | c718d4ec17bb5672fd6e671e6cee7e62d41a2743 | [
"Apache-2.0"
] | null | null | null | app/crud/notification/BroadcastReadDao.py | cdlaimin/pity | c718d4ec17bb5672fd6e671e6cee7e62d41a2743 | [
"Apache-2.0"
] | null | null | null | app/crud/notification/BroadcastReadDao.py | cdlaimin/pity | c718d4ec17bb5672fd6e671e6cee7e62d41a2743 | [
"Apache-2.0"
] | null | null | null | from app.crud import Mapper
from app.models.broadcast_read_user import PityBroadcastReadUser
from app.utils.decorator import dao
from app.utils.logger import Log
@dao(PityBroadcastReadUser, Log("BroadcastReadDao"))
| 25.8 | 64 | 0.825581 | from app.crud import Mapper
from app.models.broadcast_read_user import PityBroadcastReadUser
from app.utils.decorator import dao
from app.utils.logger import Log
@dao(PityBroadcastReadUser, Log("BroadcastReadDao"))
class BroadcastReadDao(Mapper):
pass
| 0 | 19 | 22 |
fd8b24d5ab4a55dbb5bd457c401178e865cff72e | 10,689 | py | Python | neuralnet_pytorch/zoo/resnet.py | justanhduc/neuralnet-pytorch | cbb0c5a540a0ba91cb4dd20684bb00692305d193 | [
"MIT"
] | 28 | 2019-01-07T04:07:55.000Z | 2021-11-09T15:16:11.000Z | neuralnet_pytorch/zoo/resnet.py | justanhduc/neuralnet-pytorch | cbb0c5a540a0ba91cb4dd20684bb00692305d193 | [
"MIT"
] | 9 | 2019-12-25T08:00:33.000Z | 2021-11-23T09:02:34.000Z | neuralnet_pytorch/zoo/resnet.py | justanhduc/neuralnet-pytorch | cbb0c5a540a0ba91cb4dd20684bb00692305d193 | [
"MIT"
] | 3 | 2020-08-07T12:49:05.000Z | 2022-03-07T21:32:39.000Z | import torch.nn as nn
from torchvision.models.resnet import model_urls
from torchvision.models.utils import load_state_dict_from_url
from ..layers import Sequential, Conv2d, BatchNorm2d, FC, MaxPool2d, GlobalAvgPool2D, GroupNorm, \
ResNetBottleneckBlock, ResNetBasicBlock
from ..utils import batch_set_tensor
__all_... | 41.917647 | 108 | 0.633081 | import torch.nn as nn
from torchvision.models.resnet import model_urls
from torchvision.models.utils import load_state_dict_from_url
from ..layers import Sequential, Conv2d, BatchNorm2d, FC, MaxPool2d, GlobalAvgPool2D, GroupNorm, \
ResNetBottleneckBlock, ResNetBasicBlock
from ..utils import batch_set_tensor
__all_... | 4,725 | 4 | 100 |
681fdf44df870eed5993126027599f236b1340f1 | 898 | py | Python | src/server/tests/errors_test.py | andreylipattsev/almanac.httparchive.org | a05ae166c09eecdcd34e0c1882d3003b5bfee6b6 | [
"Apache-2.0"
] | 2 | 2017-10-24T18:07:15.000Z | 2018-01-04T13:22:45.000Z | src/server/tests/errors_test.py | andreylipattsev/almanac.httparchive.org | a05ae166c09eecdcd34e0c1882d3003b5bfee6b6 | [
"Apache-2.0"
] | 107 | 2019-10-10T22:56:25.000Z | 2021-06-03T05:28:54.000Z | src/server/tests/errors_test.py | andreylipattsev/almanac.httparchive.org | a05ae166c09eecdcd34e0c1882d3003b5bfee6b6 | [
"Apache-2.0"
] | 3 | 2017-04-20T18:19:13.000Z | 2018-03-01T17:58:49.000Z | from server import app, talisman
import pytest
# Create test client without https redirect
# (normally taken care of by running in debug)
@pytest.fixture
# Add a function to test routes with optional location
| 23.631579 | 64 | 0.742762 | from server import app, talisman
import pytest
# Create test client without https redirect
# (normally taken care of by running in debug)
@pytest.fixture
def client():
with app.test_client() as client:
talisman.force_https = False
yield client
# Add a function to test routes with optional locati... | 521 | 0 | 159 |
ca09f2e6316b27ce3b0407b74976f00f1271316d | 474 | py | Python | save_reg.py | deapplegate/wtgpipeline | 9693e8562022cc97bf5a96427e22965e1a5e8497 | [
"MIT"
] | 1 | 2019-03-15T04:01:19.000Z | 2019-03-15T04:01:19.000Z | save_reg.py | deapplegate/wtgpipeline | 9693e8562022cc97bf5a96427e22965e1a5e8497 | [
"MIT"
] | 5 | 2017-12-11T00:11:39.000Z | 2021-07-09T17:05:16.000Z | save_reg.py | deapplegate/wtgpipeline | 9693e8562022cc97bf5a96427e22965e1a5e8497 | [
"MIT"
] | 2 | 2017-08-15T21:19:11.000Z | 2017-10-12T00:36:35.000Z | import os
p = open(os.environ['subdir'] + '/lensing.bands','r').readlines()
i = 0
for l in p:
import re
res = re.split('\s+',l)
f_in = os.environ['subdir'] + '/' + res[0] + '/' + res[1] + '/SCIENCE/coadd_' + res[0] + '_good/coadd.reg'
from glob import glob
command = 'cp ' + f_in + ' ' + os.environ... | 29.625 | 116 | 0.540084 | import os
p = open(os.environ['subdir'] + '/lensing.bands','r').readlines()
i = 0
for l in p:
import re
res = re.split('\s+',l)
f_in = os.environ['subdir'] + '/' + res[0] + '/' + res[1] + '/SCIENCE/coadd_' + res[0] + '_good/coadd.reg'
from glob import glob
command = 'cp ' + f_in + ' ' + os.environ... | 0 | 0 | 0 |
5598346bf0687a8ecac25d85f95f0aa60618cab9 | 507 | py | Python | fileapp/migrations/0007_auto_20181015_0523.py | hanunmasitha/lung-cancer-detection-web | 588fd7b9bafe9e4f15c038c9cb7d36ec0f8d087c | [
"MIT"
] | 3 | 2018-10-31T13:54:01.000Z | 2021-06-30T02:35:27.000Z | fileapp/migrations/0007_auto_20181015_0523.py | hanunmasitha/lung-cancer-detection-web | 588fd7b9bafe9e4f15c038c9cb7d36ec0f8d087c | [
"MIT"
] | null | null | null | fileapp/migrations/0007_auto_20181015_0523.py | hanunmasitha/lung-cancer-detection-web | 588fd7b9bafe9e4f15c038c9cb7d36ec0f8d087c | [
"MIT"
] | 1 | 2021-05-25T10:53:28.000Z | 2021-05-25T10:53:28.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-10-15 05:23
from __future__ import unicode_literals
from django.db import migrations, models
import fileapp.models
| 23.045455 | 85 | 0.648915 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-10-15 05:23
from __future__ import unicode_literals
from django.db import migrations, models
import fileapp.models
class Migration(migrations.Migration):
dependencies = [
('fileapp', '0006_auto_20181015_0520'),
]
operations = [
... | 0 | 305 | 23 |
493d3e240ad48db7b633584e8796fbd1633a63b1 | 6,577 | py | Python | designatedashboard/dashboards/project/dns_domains/tables.py | designate-dns/designate-dashboard | 6c9f388b02238bca7f8150be8bdd8282a4d1329d | [
"Apache-2.0"
] | null | null | null | designatedashboard/dashboards/project/dns_domains/tables.py | designate-dns/designate-dashboard | 6c9f388b02238bca7f8150be8bdd8282a4d1329d | [
"Apache-2.0"
] | null | null | null | designatedashboard/dashboards/project/dns_domains/tables.py | designate-dns/designate-dashboard | 6c9f388b02238bca7f8150be8bdd8282a4d1329d | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# 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 applicabl... | 29.493274 | 78 | 0.629618 | # Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# 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 applicabl... | 1,173 | 340 | 269 |
b6b9ce35b11832530a861cefb9758eb7b19e04ac | 1,264 | py | Python | upcfcardsearch/c205.py | ProfessorSean/Kasutamaiza | 7a69a69258f67bbb88bebbac6da4e6e1434947e6 | [
"MIT"
] | null | null | null | upcfcardsearch/c205.py | ProfessorSean/Kasutamaiza | 7a69a69258f67bbb88bebbac6da4e6e1434947e6 | [
"MIT"
] | null | null | null | upcfcardsearch/c205.py | ProfessorSean/Kasutamaiza | 7a69a69258f67bbb88bebbac6da4e6e1434947e6 | [
"MIT"
] | null | null | null | import discord
from discord.ext import commands
from discord.utils import get | 54.956522 | 397 | 0.698576 | import discord
from discord.ext import commands
from discord.utils import get
class c205(commands.Cog, name="c205"):
def __init__(self, bot: commands.Bot):
self.bot = bot
@commands.command(name='Manoeuvre_Salt_the_Earth', aliases=['c205', 'Scorn_Operative_11'])
async def example_embed(self, ctx):
... | 976 | 165 | 46 |
72fe66142a4e6c7ab54dbf8f03de5399fac02eeb | 6,777 | py | Python | youtube_dl/extractor/sohu.py | rajkotraja/YTDownloader | 01a0c511ebfa56699c1f58164c679b24f7972681 | [
"Unlicense"
] | null | null | null | youtube_dl/extractor/sohu.py | rajkotraja/YTDownloader | 01a0c511ebfa56699c1f58164c679b24f7972681 | [
"Unlicense"
] | null | null | null | youtube_dl/extractor/sohu.py | rajkotraja/YTDownloader | 01a0c511ebfa56699c1f58164c679b24f7972681 | [
"Unlicense"
] | null | null | null | # encoding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_str,
compat_urllib_parse_urlencode,
)
from ..utils import ExtractorError
| 33.220588 | 94 | 0.460233 | # encoding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_str,
compat_urllib_parse_urlencode,
)
from ..utils import ExtractorError
class SohuIE(InfoExtractor):
_VALID_URL = r'https?://(?P<mytv>my\.)?tv\.sohu\.com/.+?/(?(mytv)|n)(?... | 4,126 | 2,650 | 23 |
af6039f26d80e5ac995061dbfe1780b92e63290a | 405 | py | Python | rss_temple/api/migrations/0005_auto_20210331_1716.py | murrple-1/rss_temple | 289197923b1e7d1213f1673d164337df17d7269b | [
"MIT"
] | null | null | null | rss_temple/api/migrations/0005_auto_20210331_1716.py | murrple-1/rss_temple | 289197923b1e7d1213f1673d164337df17d7269b | [
"MIT"
] | 8 | 2019-12-04T21:58:35.000Z | 2021-12-15T02:29:49.000Z | rss_temple/api/migrations/0005_auto_20210331_1716.py | murrple-1/rss_temple | 289197923b1e7d1213f1673d164337df17d7269b | [
"MIT"
] | null | null | null | # Generated by Django 3.1.7 on 2021-03-31 17:16
from django.db import migrations, models
| 21.315789 | 67 | 0.595062 | # Generated by Django 3.1.7 on 2021-03-31 17:16
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0004_auto_20210331_0442'),
]
operations = [
migrations.AddIndex(
model_name='feedentry',
index=models.Index(
... | 0 | 291 | 23 |
6a34206b4b731ade6c3145dc4038e1822774dedf | 4,730 | py | Python | utils/linear.py | TheoMoutakanni/TCC-EEG | ce39d455365fb042ced7d7a94cfddb682a62b141 | [
"BSD-3-Clause"
] | null | null | null | utils/linear.py | TheoMoutakanni/TCC-EEG | ce39d455365fb042ced7d7a94cfddb682a62b141 | [
"BSD-3-Clause"
] | null | null | null | utils/linear.py | TheoMoutakanni/TCC-EEG | ce39d455365fb042ced7d7a94cfddb682a62b141 | [
"BSD-3-Clause"
] | null | null | null | from sklearn.neighbors import KNeighborsClassifier, KNeighborsRegressor, NearestNeighbors
from sklearn.metrics import balanced_accuracy_score, mean_absolute_error
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from .plot import multiline
from tqdm.autonotebook import tqdm
| 37.244094 | 199 | 0.652643 | from sklearn.neighbors import KNeighborsClassifier, KNeighborsRegressor, NearestNeighbors
from sklearn.metrics import balanced_accuracy_score, mean_absolute_error
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from .plot import multiline
from tqdm.autonotebook import tqdm
def plot_knn(train_d... | 4,361 | 0 | 69 |
ea3848a5bb6ee50f5b2c27023b9af617a87f786f | 23,890 | py | Python | gapandas/query.py | flyandlure/gapandas | 31a884da101cf1e1bc0a33a171fa820c5eebf560 | [
"MIT"
] | 9 | 2020-06-08T14:43:00.000Z | 2022-03-03T18:14:02.000Z | gapandas/query.py | flyandlure/gapandas | 31a884da101cf1e1bc0a33a171fa820c5eebf560 | [
"MIT"
] | 2 | 2021-06-17T12:04:32.000Z | 2021-07-02T15:56:15.000Z | gapandas/query.py | flyandlure/gapandas | 31a884da101cf1e1bc0a33a171fa820c5eebf560 | [
"MIT"
] | 2 | 2020-06-18T10:45:38.000Z | 2021-12-19T20:00:05.000Z | """
Name: Runs a Google Analytics API query
Developer: Matt Clarke
Date: June 8, 2020
Description: Passes a payload to the Google Analytics reporting API and returns the data.
"""
import math
import pandas as pd
def show_message(verbose, message):
"""Show a message if verbose mode is True.
Args:
ver... | 61.572165 | 120 | 0.656174 | """
Name: Runs a Google Analytics API query
Developer: Matt Clarke
Date: June 8, 2020
Description: Passes a payload to the Google Analytics reporting API and returns the data.
"""
import math
import pandas as pd
def show_message(verbose, message):
"""Show a message if verbose mode is True.
Args:
ver... | 0 | 0 | 0 |
7e52f769da7f2098ca748bfb8a692c750e6a4efc | 2,464 | py | Python | sumo/metrics/tests/util_tests.py | RishabhJain2018/sumo | ad6ae0766b3d7936ef71ec8703280d378cbe0569 | [
"MIT"
] | null | null | null | sumo/metrics/tests/util_tests.py | RishabhJain2018/sumo | ad6ae0766b3d7936ef71ec8703280d378cbe0569 | [
"MIT"
] | null | null | null | sumo/metrics/tests/util_tests.py | RishabhJain2018/sumo | ad6ae0766b3d7936ef71ec8703280d378cbe0569 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
Copyright (c) Facebook, Inc. and its affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
"""
import math
import matplotlib
import numpy as np
import os
import unittest
from sumo.geometry.rot3 import Rot3
import... | 28.651163 | 78 | 0.642451 | #!/usr/bin/env python3
"""
Copyright (c) Facebook, Inc. and its affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
"""
import math
import matplotlib
import numpy as np
import os
import unittest
from sumo.geometry.rot3 import Rot3
import... | 1,846 | 14 | 131 |
c33047380969aee33f120ef3b92142f59cef8880 | 13,107 | py | Python | brax/experimental/composer/envs/ma_descs.py | bharadwaj1098/brax | 3108a0535b9b59725c97ef35732ed0378c0fd5cc | [
"Apache-2.0"
] | 1,162 | 2021-06-03T20:15:05.000Z | 2022-03-31T19:53:06.000Z | brax/experimental/composer/envs/ma_descs.py | bharadwaj1098/brax | 3108a0535b9b59725c97ef35732ed0378c0fd5cc | [
"Apache-2.0"
] | 160 | 2021-06-05T02:32:39.000Z | 2022-03-31T11:39:58.000Z | brax/experimental/composer/envs/ma_descs.py | bharadwaj1098/brax | 3108a0535b9b59725c97ef35732ed0378c0fd5cc | [
"Apache-2.0"
] | 117 | 2021-06-04T17:18:21.000Z | 2022-03-30T18:04:48.000Z | # Copyright 2021 The Brax 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 wri... | 37.991304 | 80 | 0.584573 | # Copyright 2021 The Brax 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 wri... | 167 | 0 | 23 |
b37a8f3f70b1bf355a6c89835397882a1382fd4e | 35,258 | py | Python | orange3/Orange/widgets/widget.py | rgschmitz1/BioDepot-workflow-builder | f74d904eeaf91ec52ec9b703d9fb38e9064e5a66 | [
"MIT"
] | 54 | 2017-01-08T17:21:49.000Z | 2021-11-02T08:46:07.000Z | orange3/Orange/widgets/widget.py | Synthia-3/BioDepot-workflow-builder | 4ee93abe2d79465755e82a145af3b6a6e1e79fd4 | [
"MIT"
] | 22 | 2017-03-28T06:03:14.000Z | 2021-07-28T05:43:55.000Z | orange3/Orange/widgets/widget.py | Synthia-3/BioDepot-workflow-builder | 4ee93abe2d79465755e82a145af3b6a6e1e79fd4 | [
"MIT"
] | 21 | 2017-01-26T21:12:09.000Z | 2022-01-31T21:34:59.000Z | # Module imports Input, Output and AttributeList to be used in widgets
# pylint: disable=unused-import
import sys
import os
import types
from operator import attrgetter
from AnyQt.QtWidgets import (
QWidget,
QDialog,
QVBoxLayout,
QSizePolicy,
QApplication,
QStyle,
QShortcut,
QSplitter,... | 34.874382 | 88 | 0.627943 | # Module imports Input, Output and AttributeList to be used in widgets
# pylint: disable=unused-import
import sys
import os
import types
from operator import attrgetter
from AnyQt.QtWidgets import (
QWidget,
QDialog,
QVBoxLayout,
QSizePolicy,
QApplication,
QStyle,
QShortcut,
QSplitter,... | 13,524 | 804 | 635 |
53349746c4ae32e6613cbb7bcd6802d191184382 | 3,191 | py | Python | lib/pymedphys/_experimental/film/calibrate.py | ethanio12345/pymedphys | cb34c992de8d442eced3385018a194364060092d | [
"Apache-2.0"
] | 207 | 2019-01-29T09:53:04.000Z | 2022-03-26T10:34:03.000Z | lib/pymedphys/_experimental/film/calibrate.py | ethanio12345/pymedphys | cb34c992de8d442eced3385018a194364060092d | [
"Apache-2.0"
] | 1,209 | 2019-01-29T07:52:27.000Z | 2022-03-31T20:11:24.000Z | lib/pymedphys/_experimental/film/calibrate.py | ethanio12345/pymedphys | cb34c992de8d442eced3385018a194364060092d | [
"Apache-2.0"
] | 58 | 2019-03-29T09:06:18.000Z | 2022-03-24T07:44:22.000Z | # Copyright (C) 2019 Simon Biggs
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing,... | 27.042373 | 87 | 0.667502 | # Copyright (C) 2019 Simon Biggs
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing,... | 934 | 0 | 115 |
4ef595b3133fab1a3be633aa81f835332c818d75 | 486 | py | Python | hakoblog/config.py | hakobe/hakoblog-python | 61823d5cb538e40917423740d5fe06195ed5c858 | [
"MIT"
] | 13 | 2017-01-18T12:40:07.000Z | 2019-08-24T05:34:06.000Z | hakoblog/config.py | hakobe/hakoblog-python | 61823d5cb538e40917423740d5fe06195ed5c858 | [
"MIT"
] | 1 | 2017-01-20T10:10:37.000Z | 2017-01-20T10:10:37.000Z | hakoblog/config.py | hakobe/hakoblog-python | 61823d5cb538e40917423740d5fe06195ed5c858 | [
"MIT"
] | null | null | null | import os
class Config:
"""Extendable configuation class.
This is also used for flask application config.
"""
DATABASE = "hakoblog"
DATABASE_HOST = "db"
DATABASE_USER = "root"
DATABASE_PASS = ""
TESTING = False
GLOBAL_USER_NAME = "hakobe"
CONFIG = config()
| 16.2 | 51 | 0.617284 | import os
class Config:
"""Extendable configuation class.
This is also used for flask application config.
"""
DATABASE = "hakoblog"
DATABASE_HOST = "db"
DATABASE_USER = "root"
DATABASE_PASS = ""
TESTING = False
GLOBAL_USER_NAME = "hakobe"
class Test(Config):
DATABASE = "hako... | 92 | 48 | 46 |
6bc4185435388e72947b36ae8918a2a9b1f9dbaf | 3,219 | py | Python | PYTHON_SCRIPT/DIRECTIONALITY_PLOT.py | PuneetDheer/GRANGER_CAUSALITY | 20b20bf3f72a6b0f3e32109d536d149c99e38b5e | [
"Apache-2.0"
] | null | null | null | PYTHON_SCRIPT/DIRECTIONALITY_PLOT.py | PuneetDheer/GRANGER_CAUSALITY | 20b20bf3f72a6b0f3e32109d536d149c99e38b5e | [
"Apache-2.0"
] | null | null | null | PYTHON_SCRIPT/DIRECTIONALITY_PLOT.py | PuneetDheer/GRANGER_CAUSALITY | 20b20bf3f72a6b0f3e32109d536d149c99e38b5e | [
"Apache-2.0"
] | null | null | null | """
PLOTING DIRECTIONALITY INDEX
@author: PUNEET DHEER
"""
from matplotlib.widgets import Button
import numpy as np
import matplotlib.pyplot as plt
from itertools import combinations
fig,ax = plt.subplots()
plt.subplots_adjust(bottom = 0.3)
dataDI = DI
index = np.arange(0, dataDI.shape[0],1)
... | 31.558824 | 138 | 0.547996 | """
PLOTING DIRECTIONALITY INDEX
@author: PUNEET DHEER
"""
from matplotlib.widgets import Button
import numpy as np
import matplotlib.pyplot as plt
from itertools import combinations
fig,ax = plt.subplots()
plt.subplots_adjust(bottom = 0.3)
dataDI = DI
index = np.arange(0, dataDI.shape[0],1)
... | 1,823 | 315 | 24 |
951c81f890a24c253fbe20acc0ebdbd580643414 | 353 | py | Python | libavg_charts/aid_lines/cursor_vertical_aid_line.py | imldresden/mcv-displaywall | d08cf6fab869ee03d8b3af203dd0e55b42ab4605 | [
"MIT"
] | 2 | 2019-12-12T20:57:37.000Z | 2021-09-29T02:59:19.000Z | libavg_charts/aid_lines/cursor_vertical_aid_line.py | imldresden/mcv-displaywall | d08cf6fab869ee03d8b3af203dd0e55b42ab4605 | [
"MIT"
] | null | null | null | libavg_charts/aid_lines/cursor_vertical_aid_line.py | imldresden/mcv-displaywall | d08cf6fab869ee03d8b3af203dd0e55b42ab4605 | [
"MIT"
] | null | null | null | from libavg_charts.aid_lines.cursor_aid_line import CursorAidLine
| 27.153846 | 65 | 0.694051 | from libavg_charts.aid_lines.cursor_aid_line import CursorAidLine
class CursorVerticalAidLine(CursorAidLine):
def __init__(self, **kwargs):
"""
:param kwargs: Other parameters for the base.
"""
super(CursorVerticalAidLine, self).__init__(**kwargs)
def _draw_horizontal_aid_line... | 40 | 223 | 23 |
d74ecc5f79a408405b635e40b8106dbe00d5ed62 | 3,418 | py | Python | test/cli/test_resample.py | bcdev/xcube | 9d275ef3baef8fbcea5c1fbbfb84c3d0164aecd3 | [
"MIT"
] | null | null | null | test/cli/test_resample.py | bcdev/xcube | 9d275ef3baef8fbcea5c1fbbfb84c3d0164aecd3 | [
"MIT"
] | null | null | null | test/cli/test_resample.py | bcdev/xcube | 9d275ef3baef8fbcea5c1fbbfb84c3d0164aecd3 | [
"MIT"
] | null | null | null | import os.path
from typing import List
import xarray as xr
from test.cli.helpers import CliTest, CliDataTest, TEST_ZARR_DIR
from xcube.core.verify import assert_cube
| 39.287356 | 100 | 0.546226 | import os.path
from typing import List
import xarray as xr
from test.cli.helpers import CliTest, CliDataTest, TEST_ZARR_DIR
from xcube.core.verify import assert_cube
class ResampleTest(CliTest):
def test_help_option(self):
result = self.invoke_cli(['resample', '--help'])
self.assertEqual(0, res... | 2,992 | 22 | 234 |
c37a9ffc020769662e24b8824783549b16b3048f | 130 | py | Python | fomoapp/apps.py | jennify/FomoRecommender | f363180413c377adad2f8684e403fa75542d363a | [
"Apache-2.0"
] | null | null | null | fomoapp/apps.py | jennify/FomoRecommender | f363180413c377adad2f8684e403fa75542d363a | [
"Apache-2.0"
] | null | null | null | fomoapp/apps.py | jennify/FomoRecommender | f363180413c377adad2f8684e403fa75542d363a | [
"Apache-2.0"
] | null | null | null | from __future__ import unicode_literals
from django.apps import AppConfig
| 16.25 | 39 | 0.792308 | from __future__ import unicode_literals
from django.apps import AppConfig
class FomoappConfig(AppConfig):
name = 'fomoapp'
| 0 | 31 | 23 |
157a32e0d31c399aacb07220090582e98597d165 | 1,661 | py | Python | lib/python/treadmill/infra/setup/master.py | bretttegart/treadmill | 812109e31c503a6eddaee2d3f2e1faf2833b6aaf | [
"Apache-2.0"
] | 2 | 2017-10-31T18:48:20.000Z | 2018-03-04T20:35:20.000Z | lib/python/treadmill/infra/setup/master.py | bretttegart/treadmill | 812109e31c503a6eddaee2d3f2e1faf2833b6aaf | [
"Apache-2.0"
] | null | null | null | lib/python/treadmill/infra/setup/master.py | bretttegart/treadmill | 812109e31c503a6eddaee2d3f2e1faf2833b6aaf | [
"Apache-2.0"
] | null | null | null | from treadmill.infra.setup import base_provision
from treadmill.infra import configuration, constants, exceptions
from treadmill.api import ipa
| 29.660714 | 64 | 0.536424 | from treadmill.infra.setup import base_provision
from treadmill.infra import configuration, constants, exceptions
from treadmill.api import ipa
class Master(base_provision.BaseProvision):
def setup(
self,
image,
count,
cidr_block,
tm_release,
... | 1,445 | 22 | 49 |
68fde168c2bfcbba6d16f43881489ccec054776c | 402 | py | Python | flatten-metadata.py | pettitpeon/doe-nft-traits | d05aee512364dfa0301ee859fecf524e7f1d2094 | [
"MIT"
] | null | null | null | flatten-metadata.py | pettitpeon/doe-nft-traits | d05aee512364dfa0301ee859fecf524e7f1d2094 | [
"MIT"
] | null | null | null | flatten-metadata.py | pettitpeon/doe-nft-traits | d05aee512364dfa0301ee859fecf524e7f1d2094 | [
"MIT"
] | null | null | null | import json
# Generate traits JSON from IPFS metadata
json_data = {'assets': []}
dir = 'ipfs\doe_metadata_QmcxJeVYRhyevvwQgsBfSWiY7QVmyNx1rQinzXbc1ZYut5'
for i in range(1, 10001):
with open(f'{dir}/{i}', 'r') as f:
tmp_data = json.loads(f.read())
json_data['assets'].append(tmp_data)
with open... | 28.714286 | 72 | 0.669154 | import json
# Generate traits JSON from IPFS metadata
json_data = {'assets': []}
dir = 'ipfs\doe_metadata_QmcxJeVYRhyevvwQgsBfSWiY7QVmyNx1rQinzXbc1ZYut5'
for i in range(1, 10001):
with open(f'{dir}/{i}', 'r') as f:
tmp_data = json.loads(f.read())
json_data['assets'].append(tmp_data)
with open... | 0 | 0 | 0 |
f36ef6901225d29b72559b1520a81cb654b41c2f | 5,958 | py | Python | covid/model.py | tgrrr/covid19uk | afde150b841d7a0773b0fe2b918aa1773f791bfa | [
"MIT"
] | null | null | null | covid/model.py | tgrrr/covid19uk | afde150b841d7a0773b0fe2b918aa1773f791bfa | [
"MIT"
] | null | null | null | covid/model.py | tgrrr/covid19uk | afde150b841d7a0773b0fe2b918aa1773f791bfa | [
"MIT"
] | null | null | null | """Describes a DiscreteTimeStateTransitionModel"""
import numpy as np
import tensorflow as tf
import tensorflow_probability as tfp
from tensorflow_probability.python.internal import dtype_util
from tensorflow_probability.python.internal import reparameterization
from covid.impl.util import batch_gather, transition_coo... | 35.676647 | 216 | 0.639812 | """Describes a DiscreteTimeStateTransitionModel"""
import numpy as np
import tensorflow as tf
import tensorflow_probability as tfp
from tensorflow_probability.python.internal import dtype_util
from tensorflow_probability.python.internal import reparameterization
from covid.impl.util import batch_gather, transition_coo... | 1,287 | 4,105 | 92 |
dca555d567e7a249cb4afc3c224804dd1fbd550a | 4,349 | py | Python | data_helper.py | braveld/RNN_learn | d750237cae0a4c59b0580e37c42208ee0f4e1220 | [
"Apache-2.0"
] | 204 | 2016-11-27T11:34:31.000Z | 2021-06-30T04:51:52.000Z | data_helper.py | leelicent/DeepLearning | 46cd295bf9b8f1d40d9176a14f457e4ee89c5a99 | [
"Apache-2.0"
] | 16 | 2016-12-30T05:08:30.000Z | 2019-04-12T16:12:35.000Z | data_helper.py | leelicent/DeepLearning | 46cd295bf9b8f1d40d9176a14f457e4ee89c5a99 | [
"Apache-2.0"
] | 151 | 2016-11-28T08:14:08.000Z | 2021-11-26T09:52:03.000Z | """
description: this file helps to load raw file and gennerate batch x,y
author:luchi
date:22/11/2016
"""
import numpy as np
import cPickle as pkl
#file path
dataset_path='data/subj0.pkl'
#return batch dataset
| 29.787671 | 111 | 0.673948 | """
description: this file helps to load raw file and gennerate batch x,y
author:luchi
date:22/11/2016
"""
import numpy as np
import cPickle as pkl
#file path
dataset_path='data/subj0.pkl'
def set_dataset_path(path):
dataset_path=path
def load_data(max_len,batch_size,n_words=20000,valid_portion=0.1,sort_by_le... | 4,062 | 0 | 68 |
c4ec1e134627fcfd2dd069c062bd66ddc12bdac3 | 1,788 | py | Python | src/xmlxplode/simple_xml_utils.py | LeonPoon/pydtsxplode | cbfdac6fe16c15d7d8edcc616dc4505ef0c216c9 | [
"Apache-2.0"
] | null | null | null | src/xmlxplode/simple_xml_utils.py | LeonPoon/pydtsxplode | cbfdac6fe16c15d7d8edcc616dc4505ef0c216c9 | [
"Apache-2.0"
] | null | null | null | src/xmlxplode/simple_xml_utils.py | LeonPoon/pydtsxplode | cbfdac6fe16c15d7d8edcc616dc4505ef0c216c9 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 Leon Poon and Contributors
#
# 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 ... | 34.384615 | 86 | 0.672819 | # Copyright 2016 Leon Poon and Contributors
#
# 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 ... | 1,052 | 0 | 75 |
c77ef541d9b4c2b0f9ee1094b0dbf19656b0f421 | 254 | py | Python | src/core/config.py | 0417taehyun/simple-ATM-controller | 1e2a3760a95e0d54b3550ceef08eeab10af99189 | [
"MIT"
] | 1 | 2021-11-30T05:02:31.000Z | 2021-11-30T05:02:31.000Z | src/core/config.py | 0417taehyun/simple-ATM-controller | 1e2a3760a95e0d54b3550ceef08eeab10af99189 | [
"MIT"
] | null | null | null | src/core/config.py | 0417taehyun/simple-ATM-controller | 1e2a3760a95e0d54b3550ceef08eeab10af99189 | [
"MIT"
] | null | null | null | from functools import lru_cache
from pydantic import BaseSettings
@lru_cache
| 14.111111 | 33 | 0.69685 | from functools import lru_cache
from pydantic import BaseSettings
class Settings(BaseSettings):
ATM_UUID: str
LATITUDE: str
LONGITUDE: str
class Config:
env_file = ".env"
@lru_cache
def get_settings():
return Settings()
| 20 | 108 | 45 |
14aeb9d74c2ab7933914a759084abac2ca04914c | 194 | py | Python | students/k3343/laboratory_works/Revenko_Anna/laboratory_work_1/hotel_project/hotel_app/admin.py | TonikX/ITMO_ICT_-WebProgramming_2020 | ba566c1b3ab04585665c69860b713741906935a0 | [
"MIT"
] | 10 | 2020-03-20T09:06:12.000Z | 2021-07-27T13:06:02.000Z | students/k3343/laboratory_works/Revenko_Anna/laboratory_work_1/hotel_project/hotel_app/admin.py | TonikX/ITMO_ICT_-WebProgramming_2020 | ba566c1b3ab04585665c69860b713741906935a0 | [
"MIT"
] | 134 | 2020-03-23T09:47:48.000Z | 2022-03-12T01:05:19.000Z | students/k3343/laboratory_works/Revenko_Anna/laboratory_work_1/hotel_project/hotel_app/admin.py | TonikX/ITMO_ICT_-WebProgramming_2020 | ba566c1b3ab04585665c69860b713741906935a0 | [
"MIT"
] | 71 | 2020-03-20T12:45:56.000Z | 2021-10-31T19:22:25.000Z | from django.contrib import admin
from .models import *
# Register your models here.
admin.site.register(Hotel)
admin.site.register(Owner)
admin.site.register(Room)
admin.site.register(Comment)
| 21.555556 | 32 | 0.798969 | from django.contrib import admin
from .models import *
# Register your models here.
admin.site.register(Hotel)
admin.site.register(Owner)
admin.site.register(Room)
admin.site.register(Comment)
| 0 | 0 | 0 |
7f6c1a26de6ce129ba75b956c00124b94744ec31 | 1,575 | py | Python | test/python/old/test_crumbs.py | Hap-Hugh/quicksel | 10eee90b759638d5c54ba19994ae8e36e90e12b8 | [
"Apache-2.0"
] | 15 | 2020-07-07T16:32:53.000Z | 2022-03-16T14:23:23.000Z | test/python/old/test_crumbs.py | Hap-Hugh/quicksel | 10eee90b759638d5c54ba19994ae8e36e90e12b8 | [
"Apache-2.0"
] | 2 | 2020-09-02T15:25:39.000Z | 2020-09-24T08:37:18.000Z | test/python/old/test_crumbs.py | Hap-Hugh/quicksel | 10eee90b759638d5c54ba19994ae8e36e90e12b8 | [
"Apache-2.0"
] | 6 | 2020-08-14T22:02:07.000Z | 2021-03-31T07:08:29.000Z | from test_include import *
import numpy as np
data = generate_dataset()
past_queries = []
past_queries.append(Query([0.2, 0.2, 0.6, 0.6], 0.4, 1))
test_queries, freqmat = generate_test_queries(data)
quickSel = Crumbs()
quickSel.assign_optimal_freq(past_queries)
crumbs_answers = map(lambda t: quickSel.answer(t), tes... | 26.694915 | 71 | 0.596825 | from test_include import *
import numpy as np
def generate_dataset(size = 100000, seed = 1):
np.random.seed(seed)
cov = np.array([[0.09, 0.04], [0.04, 0.09]])
mean = np.array([0.5, 0.5])
return np.random.multivariate_normal(mean, cov, size)
def count_tuple(data, boundary):
assert(len(boundary) == ... | 1,044 | 0 | 92 |
c8e19931de78fc46235c3868273adb5e0c660448 | 2,340 | py | Python | tdp/mtc/Clean/HurcoDataClean.py | usnistgov/smstestbed | 968279f14ebe96c03c8877eeb1901cf6b4c8fbab | [
"Unlicense"
] | 16 | 2016-04-04T17:50:39.000Z | 2021-07-24T02:46:03.000Z | tdp/mtc/Clean/HurcoDataClean.py | Liming-Jsl/smstestbed | 968279f14ebe96c03c8877eeb1901cf6b4c8fbab | [
"Unlicense"
] | 1 | 2019-06-23T00:18:57.000Z | 2019-08-06T12:44:17.000Z | tdp/mtc/Clean/HurcoDataClean.py | Liming-Jsl/smstestbed | 968279f14ebe96c03c8877eeb1901cf6b4c8fbab | [
"Unlicense"
] | 9 | 2016-09-10T18:27:23.000Z | 2021-01-01T23:42:05.000Z | #!/usr/bin/env python3
import os
import sys
import fileinput
import itertools
# Define input and output files
fileToClean = '/Users/tdh1/Desktop/MTCdata/2-17-2017-Hurco04.txt' #input file
fileToSave = '/Users/tdh1/Desktop/MTCdata/2-17-2017-Hurco04-Clean.txt' #output file
fileToTemp = '/Users/tdh1/Desktop/MTCdata/Temp.... | 39.661017 | 128 | 0.705128 | #!/usr/bin/env python3
import os
import sys
import fileinput
import itertools
# Define input and output files
fileToClean = '/Users/tdh1/Desktop/MTCdata/2-17-2017-Hurco04.txt' #input file
fileToSave = '/Users/tdh1/Desktop/MTCdata/2-17-2017-Hurco04-Clean.txt' #output file
fileToTemp = '/Users/tdh1/Desktop/MTCdata/Temp.... | 0 | 0 | 0 |
0c8a81f16622f22913ab39f1336106ab067eac20 | 1,046 | py | Python | Services/Twitch/Playback/TwitchPlaylistReader.py | jbzdarkid/TwitchLink | c7bae13b46c7e6af7dc74539fdbca9cbb01f4778 | [
"MIT"
] | 26 | 2021-02-04T00:29:21.000Z | 2022-03-25T17:14:43.000Z | Services/Twitch/Playback/TwitchPlaylistReader.py | jbzdarkid/TwitchLink | c7bae13b46c7e6af7dc74539fdbca9cbb01f4778 | [
"MIT"
] | 19 | 2021-02-04T01:27:07.000Z | 2022-03-19T16:22:46.000Z | Services/Twitch/Playback/TwitchPlaylistReader.py | jbzdarkid/TwitchLink | c7bae13b46c7e6af7dc74539fdbca9cbb01f4778 | [
"MIT"
] | 10 | 2021-06-08T17:41:40.000Z | 2022-03-28T22:38:40.000Z | import re
| 28.27027 | 75 | 0.478967 | import re
class PlaylistTag:
def __init__(self, name, data):
self.name = name
self.data = data
class PlaylistReader:
TAG_WITH_DATA = re.compile("#(.*?):(.*)")
TAG_WITHOUT_DATA = re.compile("#(.*)")
def getTag(self, string):
tag = re.match(self.TAG_WITH_DATA, string)
i... | 824 | 140 | 72 |
1cc4e97ba2410ce58873d30debcd0de6996ebae1 | 319 | py | Python | python-codes/m2_curso_em_video_estruturas_de_controle/ex060.0.py | lucasportella/learning_repo | a9449dffd489e7e1f1619e3acef86bc2c64f0f14 | [
"MIT"
] | null | null | null | python-codes/m2_curso_em_video_estruturas_de_controle/ex060.0.py | lucasportella/learning_repo | a9449dffd489e7e1f1619e3acef86bc2c64f0f14 | [
"MIT"
] | null | null | null | python-codes/m2_curso_em_video_estruturas_de_controle/ex060.0.py | lucasportella/learning_repo | a9449dffd489e7e1f1619e3acef86bc2c64f0f14 | [
"MIT"
] | null | null | null | num = int(input('Digite um valor p/ saber seu fatorial: '))
c = num
d = num
print('{}!= {}x'.format(num,num),end='')
while c != 1:
c -= 1
num += (c * num) - num
if c != 1:
print('{}x'.format(c), end='')
else:
print('{}'.format(c), end='')
print('\nO fatorial de {} é {}.'.format(d,num))
| 24.538462 | 59 | 0.489028 | num = int(input('Digite um valor p/ saber seu fatorial: '))
c = num
d = num
print('{}!= {}x'.format(num,num),end='')
while c != 1:
c -= 1
num += (c * num) - num
if c != 1:
print('{}x'.format(c), end='')
else:
print('{}'.format(c), end='')
print('\nO fatorial de {} é {}.'.format(d,num))
| 0 | 0 | 0 |
9549f4377bf3752dfffca66c9c950253f91c9298 | 3,814 | py | Python | ymir/utils/indexes.py | karlcow/ymir | 17480db4a6b782130c3c68f5fa255999d2aec8e6 | [
"MIT"
] | 1 | 2021-07-08T08:41:25.000Z | 2021-07-08T08:41:25.000Z | ymir/utils/indexes.py | karlcow/ymir | 17480db4a6b782130c3c68f5fa255999d2aec8e6 | [
"MIT"
] | 16 | 2015-10-29T00:24:03.000Z | 2021-05-16T23:28:55.000Z | ymir/utils/indexes.py | karlcow/ymir | 17480db4a6b782130c3c68f5fa255999d2aec8e6 | [
"MIT"
] | 1 | 2020-12-06T22:05:12.000Z | 2020-12-06T22:05:12.000Z | #!/usr/bin/env python
# encoding: utf-8
"""
Parses and updates indexes files.
Created by Karl Dubost on 2018-03-25.
Copyright (c) 2018 Grange. All rights reserved.
see LICENSE.TXT
"""
import datetime
import logging
import os
import string
import sys
import lxml.html
from lxml import etree
from ymir.utils import hel... | 30.758065 | 72 | 0.673047 | #!/usr/bin/env python
# encoding: utf-8
"""
Parses and updates indexes files.
Created by Karl Dubost on 2018-03-25.
Copyright (c) 2018 Grange. All rights reserved.
see LICENSE.TXT
"""
import datetime
import logging
import os
import string
import sys
import lxml.html
from lxml import etree
from ymir.utils import hel... | 0 | 0 | 0 |
3cf6585d47a80e33ad90b80b6f06cdc977d3d26a | 7,983 | py | Python | io-apparillo6.py | RO-LIP/Apparillo-6 | f332df3404565f7b289d4615e3dab1f4aaf23eb4 | [
"MIT"
] | 2 | 2019-11-05T16:47:26.000Z | 2020-07-22T09:26:04.000Z | io-apparillo6.py | RO-LIP/Apparillo-6 | f332df3404565f7b289d4615e3dab1f4aaf23eb4 | [
"MIT"
] | null | null | null | io-apparillo6.py | RO-LIP/Apparillo-6 | f332df3404565f7b289d4615e3dab1f4aaf23eb4 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
from gpiozero import RGBLED, Button, LED, DigitalOutputDevice
from time import sleep
from subprocess import getoutput
from signal import pause
from os import system
'''
Script zum aktivieren verschiedener Ein- und Ausgabegeraete
-Rotary Encoder zur Lautstaerkeregelung
-RGB LED zur Anzeige/Visualisie... | 37.834123 | 150 | 0.721909 | #!/usr/bin/python3
from gpiozero import RGBLED, Button, LED, DigitalOutputDevice
from time import sleep
from subprocess import getoutput
from signal import pause
from os import system
'''
Script zum aktivieren verschiedener Ein- und Ausgabegeraete
-Rotary Encoder zur Lautstaerkeregelung
-RGB LED zur Anzeige/Visualisie... | 2,387 | 0 | 207 |
bec62ffb77243879ac334a2faa4a7030fe52b5eb | 1,661 | py | Python | systori/apps/accounting/forms.py | systori/systori | e309c63e735079ff6032fdaf1db354ec872b28b1 | [
"BSD-3-Clause"
] | 12 | 2018-01-30T00:44:06.000Z | 2020-07-13T05:20:48.000Z | systori/apps/accounting/forms.py | systori/systori | e309c63e735079ff6032fdaf1db354ec872b28b1 | [
"BSD-3-Clause"
] | 36 | 2018-03-06T17:49:50.000Z | 2020-06-23T19:26:00.000Z | systori/apps/accounting/forms.py | systori/systori | e309c63e735079ff6032fdaf1db354ec872b28b1 | [
"BSD-3-Clause"
] | 3 | 2018-08-03T07:03:09.000Z | 2020-07-09T20:21:10.000Z | from django.utils.translation import ugettext_lazy as _
from django.forms import ModelForm, ValidationError
from .workflow import Account
from .constants import BANK_CODE_RANGE
| 30.2 | 90 | 0.556291 | from django.utils.translation import ugettext_lazy as _
from django.forms import ModelForm, ValidationError
from .workflow import Account
from .constants import BANK_CODE_RANGE
class AccountForm(ModelForm):
class Meta:
model = Account
fields = ["name"]
class BankAccountForm(ModelForm):
class... | 1,222 | 214 | 46 |
b66d30840dbe7bbb7607d1d78f5f8a7ee0f6d9a1 | 8,672 | py | Python | pkgs/ipywidgets-4.1.1-py27_0/lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.py | wangyum/anaconda | 6e5a0dbead3327661d73a61e85414cf92aa52be6 | [
"Apache-2.0",
"BSD-3-Clause"
] | 652 | 2015-07-26T00:00:17.000Z | 2022-02-24T18:30:04.000Z | pkgs/ipywidgets-4.1.1-py27_0/lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.py | wangyum/anaconda | 6e5a0dbead3327661d73a61e85414cf92aa52be6 | [
"Apache-2.0",
"BSD-3-Clause"
] | 8 | 2015-09-07T03:38:19.000Z | 2021-05-23T03:18:51.000Z | pkgs/ipywidgets-4.1.1-py27_0/lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.py | wangyum/anaconda | 6e5a0dbead3327661d73a61e85414cf92aa52be6 | [
"Apache-2.0",
"BSD-3-Clause"
] | 40 | 2015-07-24T19:45:08.000Z | 2021-11-01T14:54:56.000Z | """Selection classes.
Represents an enumeration using a widget.
"""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
from collections import OrderedDict
from threading import Lock
from .widget import DOMWidget, register
from traitlets import (
Unicode, Bool, A... | 37.541126 | 129 | 0.618773 | """Selection classes.
Represents an enumeration using a widget.
"""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
from collections import OrderedDict
from threading import Lock
from .widget import DOMWidget, register
from traitlets import (
Unicode, Bool, A... | 1,958 | 0 | 181 |
1d85abc996c1aa159699afac88d2c880583b1ea5 | 5,152 | py | Python | channels/views/subscribers_test.py | mitodl/open-discussions | ab6e9fac70b8a1222a84e78ba778a7a065c20541 | [
"BSD-3-Clause"
] | 12 | 2017-09-27T21:23:27.000Z | 2020-12-25T04:31:30.000Z | channels/views/subscribers_test.py | mitodl/open-discussions | ab6e9fac70b8a1222a84e78ba778a7a065c20541 | [
"BSD-3-Clause"
] | 3,293 | 2017-06-30T18:16:01.000Z | 2022-03-31T18:01:34.000Z | channels/views/subscribers_test.py | mitodl/open-discussions | ab6e9fac70b8a1222a84e78ba778a7a065c20541 | [
"BSD-3-Clause"
] | 1 | 2020-04-13T12:19:57.000Z | 2020-04-13T12:19:57.000Z | """Tests for views for REST APIs for channels"""
# pylint: disable=unused-argument
import pytest
from django.urls import reverse
from rest_framework import status
from open_discussions.constants import NOT_AUTHENTICATED_ERROR_TYPE
from open_discussions.factories import UserFactory
pytestmark = [pytest.mark.betamax, p... | 37.064748 | 88 | 0.715256 | """Tests for views for REST APIs for channels"""
# pylint: disable=unused-argument
import pytest
from django.urls import reverse
from rest_framework import status
from open_discussions.constants import NOT_AUTHENTICATED_ERROR_TYPE
from open_discussions.factories import UserFactory
pytestmark = [pytest.mark.betamax, p... | 0 | 0 | 0 |
9b8b48d76af3cebe5d1e2dba50582dfa6df79b01 | 1,177 | py | Python | test/unit/tasks/test_clustering.py | Kwentar/FEDOT | 97a561698c0aa006aa627fc56965a0bc251a4ed8 | [
"BSD-3-Clause"
] | null | null | null | test/unit/tasks/test_clustering.py | Kwentar/FEDOT | 97a561698c0aa006aa627fc56965a0bc251a4ed8 | [
"BSD-3-Clause"
] | null | null | null | test/unit/tasks/test_clustering.py | Kwentar/FEDOT | 97a561698c0aa006aa627fc56965a0bc251a4ed8 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
from fedot.core.chains.chain import Chain
from fedot.core.chains.node import PrimaryNode, SecondaryNode
from fedot.core.data.data_split import train_test_data_setup
from test.unit.models.test_split_train_test import get_roc_auc_value, get_synthetic_input_data
| 34.617647 | 94 | 0.75446 | import numpy as np
from fedot.core.chains.chain import Chain
from fedot.core.chains.node import PrimaryNode, SecondaryNode
from fedot.core.data.data_split import train_test_data_setup
from test.unit.models.test_split_train_test import get_roc_auc_value, get_synthetic_input_data
def generate_chain() -> Chain:
nod... | 849 | 0 | 46 |
2e8f783bec79c4f99b4c04359ccca01d0df7da5c | 2,983 | py | Python | Platforms/Web/Processing/Api/Discord/Levels/get.py | HeapUnderfl0w/Phaazebot | 54e637bd4bc213b8efdaf23d5f331f2569e96843 | [
"MIT"
] | null | null | null | Platforms/Web/Processing/Api/Discord/Levels/get.py | HeapUnderfl0w/Phaazebot | 54e637bd4bc213b8efdaf23d5f331f2569e96843 | [
"MIT"
] | null | null | null | Platforms/Web/Processing/Api/Discord/Levels/get.py | HeapUnderfl0w/Phaazebot | 54e637bd4bc213b8efdaf23d5f331f2569e96843 | [
"MIT"
] | null | null | null | from typing import TYPE_CHECKING
if TYPE_CHECKING:
from Platforms.Web.index import WebIndex
from Platforms.Discord.main_discord import PhaazebotDiscord
import json
import discord
from aiohttp.web import Response, Request
from Utils.Classes.webrequestcontent import WebRequestContent
from Platforms.Discord.utils impor... | 33.144444 | 190 | 0.745558 | from typing import TYPE_CHECKING
if TYPE_CHECKING:
from Platforms.Web.index import WebIndex
from Platforms.Discord.main_discord import PhaazebotDiscord
import json
import discord
from aiohttp.web import Response, Request
from Utils.Classes.webrequestcontent import WebRequestContent
from Platforms.Discord.utils impor... | 0 | 0 | 0 |
031aad9cd1e15fd82b333daf9169e15d94fc14ba | 69,293 | py | Python | episodes/ep1/phasors.py | pj0620/acca-video-series | 1b09548014cc899ded5a8fdd1293f7fc121a98bc | [
"MIT"
] | null | null | null | episodes/ep1/phasors.py | pj0620/acca-video-series | 1b09548014cc899ded5a8fdd1293f7fc121a98bc | [
"MIT"
] | 3 | 2020-04-16T09:24:48.000Z | 2021-03-27T19:27:48.000Z | episodes/ep1/phasors.py | pj0620/acca-video-series | 1b09548014cc899ded5a8fdd1293f7fc121a98bc | [
"MIT"
] | 1 | 2020-09-01T05:32:04.000Z | 2020-09-01T05:32:04.000Z | from manimlib.imports import *
from accalib.electrical_circuits import BatteryLampCircuit, BatteryLampCircuitAC
from accalib.particles import Electron
from accalib.lines import DottedLine
from accalib.tools import rule_of_thirds_guide
| 31.902855 | 131 | 0.521351 | from manimlib.imports import *
from accalib.electrical_circuits import BatteryLampCircuit, BatteryLampCircuitAC
from accalib.particles import Electron
from accalib.lines import DottedLine
from accalib.tools import rule_of_thirds_guide
class IntroPhasorsPart(Scene):
def construct(self):
section_label = Te... | 64,706 | 4,107 | 236 |
3aeb56580501070191a78807b1b87cf2ec8fa414 | 77 | py | Python | xtp_job_control/__init__.py | votca/xtp_job_control | e996e848666780fd2135b74550fb0111cb2be7bd | [
"Apache-2.0"
] | null | null | null | xtp_job_control/__init__.py | votca/xtp_job_control | e996e848666780fd2135b74550fb0111cb2be7bd | [
"Apache-2.0"
] | 9 | 2019-01-08T12:04:06.000Z | 2020-03-06T13:24:00.000Z | xtp_job_control/__init__.py | votca/xtp_job_control | e996e848666780fd2135b74550fb0111cb2be7bd | [
"Apache-2.0"
] | 2 | 2019-01-24T12:14:59.000Z | 2021-02-10T15:36:51.000Z | from .workflows.run_workflow import run_workflow
__all__ = ['run_workflow']
| 19.25 | 48 | 0.805195 | from .workflows.run_workflow import run_workflow
__all__ = ['run_workflow']
| 0 | 0 | 0 |
af2a991f446833fd155e1c954b8639131eac45b0 | 1,346 | py | Python | image.py | dhruvsheth-ai/Spatio-Temporal-GAN | 2a4c63ec4e9ecc941c0d182c0580642000a4cb08 | [
"MIT"
] | null | null | null | image.py | dhruvsheth-ai/Spatio-Temporal-GAN | 2a4c63ec4e9ecc941c0d182c0580642000a4cb08 | [
"MIT"
] | null | null | null | image.py | dhruvsheth-ai/Spatio-Temporal-GAN | 2a4c63ec4e9ecc941c0d182c0580642000a4cb08 | [
"MIT"
] | null | null | null | import cv2
import numpy as np
import cmapy
import matplotlib.pyplot as plt
img = cv2.imread('/home/pi/opencv/video0007_frame0007gt_R128x128.png').astype(np.float) # BGR, float
blue = img[:,:,2]
green = img[:,:,1]
red = img[:,:,0]
exg = 2*green - red - blue
print("max exg", exg.max())
print("mean exg", exg.mean())... | 24.035714 | 102 | 0.681278 | import cv2
import numpy as np
import cmapy
import matplotlib.pyplot as plt
img = cv2.imread('/home/pi/opencv/video0007_frame0007gt_R128x128.png').astype(np.float) # BGR, float
blue = img[:,:,2]
green = img[:,:,1]
red = img[:,:,0]
exg = 2*green - red - blue
print("max exg", exg.max())
print("mean exg", exg.mean())... | 0 | 0 | 0 |
e3cd58004511256002daf9b2dcdae5ea0fc7c768 | 313 | py | Python | pdsf_py2/pydysofu/__init__.py | probablytom/pydysofu | 6b760f288fb4305561e885e54652cfb11c80ef14 | [
"MIT"
] | null | null | null | pdsf_py2/pydysofu/__init__.py | probablytom/pydysofu | 6b760f288fb4305561e885e54652cfb11c80ef14 | [
"MIT"
] | null | null | null | pdsf_py2/pydysofu/__init__.py | probablytom/pydysofu | 6b760f288fb4305561e885e54652cfb11c80ef14 | [
"MIT"
] | null | null | null | """
Front end API for the fuzzi_moss library.
"""
from .fuzz_decorator import fuzz, set_fuzzer
from .fuzz_weaver import fuzz_clazz, defuzz_class, fuzz_module, defuzz_all_classes
from .config import pydysofu_random
from .core_fuzzers import fuzzer_invocations, fuzzer_invocations_count, reset_invocation_counters
| 34.777778 | 97 | 0.84345 | """
Front end API for the fuzzi_moss library.
"""
from .fuzz_decorator import fuzz, set_fuzzer
from .fuzz_weaver import fuzz_clazz, defuzz_class, fuzz_module, defuzz_all_classes
from .config import pydysofu_random
from .core_fuzzers import fuzzer_invocations, fuzzer_invocations_count, reset_invocation_counters
| 0 | 0 | 0 |
f9f1158c6d3659c9073133ff360cd049679377b1 | 262 | py | Python | py/place/unpack.py | teppchan/tkintertips | dc4b43e86185906d72ba5d5712edee94c76f8b37 | [
"MIT"
] | null | null | null | py/place/unpack.py | teppchan/tkintertips | dc4b43e86185906d72ba5d5712edee94c76f8b37 | [
"MIT"
] | null | null | null | py/place/unpack.py | teppchan/tkintertips | dc4b43e86185906d72ba5d5712edee94c76f8b37 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import Tkinter as Tk
root=Tk.Tk()
label=Tk.Label(root, text="Label")
label.pack(side='top')
button=Tk.Button(root, text="unpack", command=label_unpack)
button.pack(side='top')
root.mainloop()
| 17.466667 | 59 | 0.717557 | #!/usr/bin/env python
import Tkinter as Tk
root=Tk.Tk()
label=Tk.Label(root, text="Label")
label.pack(side='top')
def label_unpack():
label.pack_forget()
button=Tk.Button(root, text="unpack", command=label_unpack)
button.pack(side='top')
root.mainloop()
| 22 | 0 | 23 |
306739ed8c9963e2166aeebbaffbf070008eef92 | 1,276 | py | Python | gammagl/layers/conv/appnp_conv.py | BUPT-GAMMA/GammaGL | 2b9f32e1ac3533cb75a063243e8a2fa654466d18 | [
"Apache-2.0"
] | null | null | null | gammagl/layers/conv/appnp_conv.py | BUPT-GAMMA/GammaGL | 2b9f32e1ac3533cb75a063243e8a2fa654466d18 | [
"Apache-2.0"
] | null | null | null | gammagl/layers/conv/appnp_conv.py | BUPT-GAMMA/GammaGL | 2b9f32e1ac3533cb75a063243e8a2fa654466d18 | [
"Apache-2.0"
] | null | null | null | import tensorlayerx as tlx
from gammagl.layers.conv import MessagePassing
class APPNPConv(MessagePassing):
'''
Approximate personalized propagation of neural predictions
'''
| 34.486486 | 91 | 0.561912 | import tensorlayerx as tlx
from gammagl.layers.conv import MessagePassing
class APPNPConv(MessagePassing):
'''
Approximate personalized propagation of neural predictions
'''
def __init__(self,
in_channels,
out_channels,
iter_K,
alpha,
... | 1,036 | 0 | 53 |