hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3da55060c919b50297a4552fec6032bcf0f5ca39 | 1,605 | py | Python | flask_appify/ext/appengine.py | RealKinetic/flask-appify | 3bfc649ab96fca92abeb03bd37b976f3de7dbbc3 | [
"Apache-2.0"
] | null | null | null | flask_appify/ext/appengine.py | RealKinetic/flask-appify | 3bfc649ab96fca92abeb03bd37b976f3de7dbbc3 | [
"Apache-2.0"
] | null | null | null | flask_appify/ext/appengine.py | RealKinetic/flask-appify | 3bfc649ab96fca92abeb03bd37b976f3de7dbbc3 | [
"Apache-2.0"
] | null | null | null |
from flask_appify.util import request_wants_json
try:
from google.appengine.api import datastore_errors
except ImportError:
# not on the AppEngine platform
datastore_errors = None
__all__ = [
'init_app',
]
html_response = {
503: """<!doctype html><html><head><title>503 Service
Unavailable</tit... | 26.75 | 77 | 0.699688 | import functools
from flask_appify.util import request_wants_json
try:
from google.appengine.api import datastore_errors
except ImportError:
# not on the AppEngine platform
datastore_errors = None
__all__ = [
'init_app',
]
html_response = {
503: """<!doctype html><html><head><title>503 Service... | 0 | 0 | 0 | 0 | 0 | 391 | 0 | -5 | 45 |
e70169b20bf89f034aa2f15f946cacbc5c045ef2 | 1,146 | py | Python | my_receipts/apps/receipts/tests/test_parsers.py | Tvrsch/my_receipts | 0a905d2366cee3b62f2dd083af1622afeb648bef | [
"MIT"
] | null | null | null | my_receipts/apps/receipts/tests/test_parsers.py | Tvrsch/my_receipts | 0a905d2366cee3b62f2dd083af1622afeb648bef | [
"MIT"
] | 11 | 2021-05-10T15:40:38.000Z | 2022-02-28T21:09:37.000Z | my_receipts/apps/receipts/tests/test_parsers.py | Tvrsch/my_receipts | 0a905d2366cee3b62f2dd083af1622afeb648bef | [
"MIT"
] | 2 | 2021-09-18T18:49:58.000Z | 2021-11-17T12:29:13.000Z | from pathlib import Path
import pytest
CURRENT_DIR = Path(__file__).resolve(strict=True).parent
pytestmark = pytest.mark.django_db
| 30.157895 | 82 | 0.711169 | from datetime import datetime
from pathlib import Path
import pytest
from my_receipts.apps.receipts.parsers import TaxcomParser
CURRENT_DIR = Path(__file__).resolve(strict=True).parent
pytestmark = pytest.mark.django_db
def test_taxcom(requests_mock):
with open(CURRENT_DIR / "taxcom_page.html", encoding="utf8... | 122 | 0 | 0 | 0 | 0 | 837 | 0 | 45 | 68 |
3f3179753f11234dd6a4245ab4afb96624ed7961 | 341 | py | Python | django_fastapi/api/migrations/0005_rename_id_login_id2.py | ehddn5252/FastAPI_Django | a179aedb62c28d1700578882e681002a61576060 | [
"MIT"
] | null | null | null | django_fastapi/api/migrations/0005_rename_id_login_id2.py | ehddn5252/FastAPI_Django | a179aedb62c28d1700578882e681002a61576060 | [
"MIT"
] | null | null | null | django_fastapi/api/migrations/0005_rename_id_login_id2.py | ehddn5252/FastAPI_Django | a179aedb62c28d1700578882e681002a61576060 | [
"MIT"
] | 1 | 2021-11-26T08:22:57.000Z | 2021-11-26T08:22:57.000Z | # Generated by Django 3.2.9 on 2021-11-18 17:50
| 17.947368 | 47 | 0.557185 | # Generated by Django 3.2.9 on 2021-11-18 17:50
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('api', '0004_login_id'),
]
operations = [
migrations.RenameField(
model_name='login',
old_name='id',
new_name='id... | 0 | 0 | 0 | 235 | 0 | 0 | 0 | 11 | 46 |
037795ac1abedf72121969ab98a1ef082062b78c | 6,589 | py | Python | data/Luminometrics/htbayes.py | ericmjl/protein-systematic-characterization | 3ac44d672380490d8e602aa024e40009fdf306b0 | [
"MIT"
] | null | null | null | data/Luminometrics/htbayes.py | ericmjl/protein-systematic-characterization | 3ac44d672380490d8e602aa024e40009fdf306b0 | [
"MIT"
] | 44 | 2016-08-31T14:58:13.000Z | 2017-04-07T19:01:56.000Z | data/Luminometrics/htbayes.py | ericmjl/protein-systematic-characterization | 3ac44d672380490d8e602aa024e40009fdf306b0 | [
"MIT"
] | 1 | 2016-08-31T14:33:35.000Z | 2016-08-31T14:33:35.000Z | # -*- coding: utf-8 -*-
"""
Created on Wed Nov 30 17:56:58 2016
@author: Vivian Zhong
"""
if __name__ == '__main__':
main() | 35.616216 | 81 | 0.591137 | # -*- coding: utf-8 -*-
"""
Created on Wed Nov 30 17:56:58 2016
@author: Vivian Zhong
"""
import click
import pymc3 as pm
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import logging
@click.command()
@click.option('--filename', default='data.csv',
help='Fi... | 0 | 1,060 | 0 | 5,136 | 0 | 52 | 0 | -14 | 224 |
6192fb7a57daf01ebdb8110a9977c021054793ab | 150 | py | Python | python/armstrong.py | lukasjoc/random | 5be080b424f02491fb219634902fc0cc192aff6c | [
"0BSD"
] | 1 | 2020-11-09T19:32:43.000Z | 2020-11-09T19:32:43.000Z | python/armstrong.py | lukasjoc/random | 5be080b424f02491fb219634902fc0cc192aff6c | [
"0BSD"
] | null | null | null | python/armstrong.py | lukasjoc/random | 5be080b424f02491fb219634902fc0cc192aff6c | [
"0BSD"
] | null | null | null | #!/usr/local/bin/python3
if __name__ == "__main__":
arm(2)
| 13.636364 | 28 | 0.586667 | #!/usr/local/bin/python3
def arm(number int) -> bool:
for d in number:
print(d)
return False
if __name__ == "__main__":
arm(2)
| 0 | 0 | 0 | 0 | 0 | 62 | 0 | 0 | 23 |
1772f57bf5430988d5b8a92657ecfe7e16777a86 | 4,324 | py | Python | main_2.py | NathanMaton/stargan_single_image | b46837d1dd618bdd68ea4813d2a051df736e7399 | [
"MIT"
] | null | null | null | main_2.py | NathanMaton/stargan_single_image | b46837d1dd618bdd68ea4813d2a051df736e7399 | [
"MIT"
] | 8 | 2020-11-13T18:52:25.000Z | 2022-02-10T01:59:43.000Z | main_2.py | NathanMaton/stargan_single_image | b46837d1dd618bdd68ea4813d2a051df736e7399 | [
"MIT"
] | null | null | null | '''
TO-DO:
GET BETTER RESULTS
CLEAN UP THIS CODE TO GET THE SINGLE PROCESSING EASIER TO USE
REDO AS A PR TO ORIGINAL REPO
'''
from solver import Solver
from data_loader import get_loader
# celeba_loader = get_loader(config.celeba_image_dir, config.attr_path, config.selected_attrs,
# config... | 30.027778 | 100 | 0.624191 | '''
TO-DO:
GET BETTER RESULTS
CLEAN UP THIS CODE TO GET THE SINGLE PROCESSING EASIER TO USE
REDO AS A PR TO ORIGINAL REPO
'''
import os
import argparse
from solver import Solver
from data_loader import get_loader
from torch.backends import cudnn
# celeba_loader = get_loader(config.celeba_image_dir, config.attr_path... | 0 | 0 | 0 | 1,732 | 0 | 1,596 | 0 | -7 | 136 |
1ef202fcfbe1e539d7edcd862acda06dba044d6d | 1,600 | py | Python | openchem/layers/gcn.py | jmhayesesq/Open-Chem | e612d5cd471079c64e61ceda946c3dc7cf095bd8 | [
"MIT"
] | 466 | 2018-08-10T04:58:42.000Z | 2022-03-29T07:04:39.000Z | openchem/layers/gcn.py | jmhayesesq/Open-Chem | e612d5cd471079c64e61ceda946c3dc7cf095bd8 | [
"MIT"
] | 15 | 2019-08-06T08:23:11.000Z | 2022-01-23T22:39:52.000Z | openchem/layers/gcn.py | jmhayesesq/Open-Chem | e612d5cd471079c64e61ceda946c3dc7cf095bd8 | [
"MIT"
] | 91 | 2018-08-19T00:37:50.000Z | 2022-02-27T11:15:31.000Z | # modified from https://github.com/tkipf/pygcn/blob/master/pygcn/layers.py
import torch.nn as nn
| 33.333333 | 77 | 0.625625 | # modified from https://github.com/tkipf/pygcn/blob/master/pygcn/layers.py
import math
import torch
import torch.nn as nn
from torch.nn.parameter import Parameter
class GraphConvolution(nn.Module):
"""
Simple GCN layer, similar to https://arxiv.org/abs/1609.02907
"""
def __init__(self, in_features,... | 0 | 0 | 0 | 1,410 | 0 | 0 | 0 | 0 | 92 |
f4ff0fcd3bec384fcf5b2cfb85a770e9589fe089 | 80 | py | Python | py/authdata-example.py | flopp/safari | d7c8fca838cecbba738a547a8852bf40abed0409 | [
"MIT"
] | 1 | 2018-12-09T19:37:05.000Z | 2018-12-09T19:37:05.000Z | py/authdata-example.py | flopp/safari | d7c8fca838cecbba738a547a8852bf40abed0409 | [
"MIT"
] | 9 | 2015-02-14T20:41:08.000Z | 2015-07-25T10:32:35.000Z | py/authdata-example.py | flopp/safari | d7c8fca838cecbba738a547a8852bf40abed0409 | [
"MIT"
] | null | null | null | OC_OKAPI_KEY = "xxx"
OC_USERNAME = "xxx"
OC_PASSWORD = "xxx"
OC_QUERYID = "xxx"
| 16 | 20 | 0.7 | OC_OKAPI_KEY = "xxx"
OC_USERNAME = "xxx"
OC_PASSWORD = "xxx"
OC_QUERYID = "xxx"
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2bcd8e707519ec5796351e2ec38632750a8b4827 | 2,164 | py | Python | tests/system/data_sources/test_teradata.py | ajw0100/professional-services-data-validator | b1dc82adf92adf19702f5ef41590c62c7c128c74 | [
"Apache-2.0"
] | 167 | 2021-05-27T19:43:43.000Z | 2022-03-16T02:42:30.000Z | tests/system/data_sources/test_teradata.py | ajw0100/professional-services-data-validator | b1dc82adf92adf19702f5ef41590c62c7c128c74 | [
"Apache-2.0"
] | 110 | 2021-05-27T14:49:09.000Z | 2022-03-31T11:10:41.000Z | tests/system/data_sources/test_teradata.py | ajw0100/professional-services-data-validator | b1dc82adf92adf19702f5ef41590c62c7c128c74 | [
"Apache-2.0"
] | 32 | 2021-06-23T22:00:59.000Z | 2022-03-30T03:32:20.000Z | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 32.298507 | 77 | 0.700555 | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 0 | 0 | 0 | 0 | 0 | 225 | 0 | 17 | 23 |
b770869444f6fb03f601c5c9ff6f8b90df966db3 | 2,065 | py | Python | tf/mnist_test.py | skolchin/gbr | 3ec4b72e0352d36f38f5cd5815b69fac0b7a3e9c | [
"MIT"
] | 29 | 2019-10-10T22:51:55.000Z | 2022-03-09T05:57:59.000Z | tf/mnist_test.py | skolchin/gbr | 3ec4b72e0352d36f38f5cd5815b69fac0b7a3e9c | [
"MIT"
] | 1 | 2020-12-07T06:51:50.000Z | 2020-12-08T16:59:20.000Z | tf/mnist_test.py | skolchin/gbr | 3ec4b72e0352d36f38f5cd5815b69fac0b7a3e9c | [
"MIT"
] | 11 | 2020-12-09T01:44:38.000Z | 2022-03-20T17:40:02.000Z | #-------------------------------------------------------------------------------
# Name: MNIST TensorFlow example
# Purpose: Experiments with TensorFlow
#
# Author: kol
#
# Created: 09.01.2020
# Copyright: (c) kol 2020
#------------------------------------------------------------------------------... | 27.533333 | 80 | 0.582567 | #-------------------------------------------------------------------------------
# Name: MNIST TensorFlow example
# Purpose: Experiments with TensorFlow
#
# Author: kol
#
# Created: 09.01.2020
# Copyright: (c) kol 2020
#------------------------------------------------------------------------------... | 0 | 0 | 0 | 0 | 0 | 446 | 0 | -3 | 45 |
e40e9d7f20ea238e67e6d5c2573d672e7aa05b32 | 3,321 | py | Python | ivy_mech_tests/test_orientation/orientation_data.py | unifyai/mech | d678c8732ee5aba4a92fb37b96519cd06553c0c6 | [
"Apache-2.0"
] | 1 | 2021-10-11T17:58:41.000Z | 2021-10-11T17:58:41.000Z | ivy_mech_tests/test_orientation/orientation_data.py | ivy-dl/mech | f3ce5f7b38fe2c453a066f58019ff84dcee517a6 | [
"Apache-2.0"
] | null | null | null | ivy_mech_tests/test_orientation/orientation_data.py | ivy-dl/mech | f3ce5f7b38fe2c453a066f58019ff84dcee517a6 | [
"Apache-2.0"
] | null | null | null | """
test data for orientation functions
"""
# global
| 40.5 | 109 | 0.563686 | """
test data for orientation functions
"""
# global
import numpy as np
class OrientationTestData:
def __init__(self):
# axis
axis = np.array([[1., 2., 3.]])
self.axis = axis / np.linalg.norm(axis)
self.batched_axis = np.expand_dims(self.axis, 0)
# angle
self.ang... | 0 | 0 | 0 | 3,224 | 0 | 0 | 0 | -3 | 45 |
3374968f5ffa11f472f968bd304b1ae949911373 | 1,805 | py | Python | drf_integrations/utils.py | yoyowallet/drf-integrations-framework | 7cf5cd28e5aff80c9b1a34b461294f4bd3108fa9 | [
"MIT"
] | 1 | 2020-07-09T11:39:19.000Z | 2020-07-09T11:39:19.000Z | drf_integrations/utils.py | yoyowallet/drf-integrations-framework | 7cf5cd28e5aff80c9b1a34b461294f4bd3108fa9 | [
"MIT"
] | 5 | 2020-07-08T11:00:26.000Z | 2021-01-13T09:33:09.000Z | drf_integrations/utils.py | yoyowallet/drf-integrations-framework | 7cf5cd28e5aff80c9b1a34b461294f4bd3108fa9 | [
"MIT"
] | 2 | 2021-08-12T12:23:54.000Z | 2021-09-20T06:45:38.000Z | from typing import Any, Iterable, List, Optional, Union
AnyString = Union[str, Iterable[Any]]
def split_string(string: Optional[AnyString], separator: str = ",") -> List[str]:
"""
Breaks given *string* by the specified *separator*.
If *string* is a non-``str`` iterable, then return a list if it is not a... | 31.12069 | 90 | 0.60831 | from typing import Any, Iterable, Iterator, List, Optional, Union
AnyString = Union[str, Iterable[Any]]
def split_string(string: Optional[AnyString], separator: str = ",") -> List[str]:
"""
Breaks given *string* by the specified *separator*.
If *string* is a non-``str`` iterable, then return a list if i... | 0 | 0 | 0 | 0 | 677 | 0 | 0 | 10 | 23 |
861242ea84f9b5b122ec9897c57092bfc93096a8 | 22,227 | py | Python | pymtl/tools/translation/verilator_cffi.py | belang/pymtl | 4a96738724b007cbd684753aed0ac3de5b5dbebb | [
"BSD-3-Clause"
] | 206 | 2015-01-05T21:53:56.000Z | 2022-03-14T08:04:49.000Z | pymtl/tools/translation/verilator_cffi.py | belang/pymtl | 4a96738724b007cbd684753aed0ac3de5b5dbebb | [
"BSD-3-Clause"
] | 84 | 2015-01-25T19:57:33.000Z | 2021-05-11T15:46:56.000Z | pymtl/tools/translation/verilator_cffi.py | belang/pymtl | 4a96738724b007cbd684753aed0ac3de5b5dbebb | [
"BSD-3-Clause"
] | 99 | 2015-02-17T17:43:44.000Z | 2022-02-14T17:58:18.000Z | #=======================================================================
# verilator_cffi.py
#=======================================================================
from __future__ import print_function
#-----------------------------------------------------------------------
# verilog_to_pymtl
#---------------------... | 33.728376 | 88 | 0.587394 | #=======================================================================
# verilator_cffi.py
#=======================================================================
from __future__ import print_function
import os
import shutil
import verilog_structural
from ...tools.simulation.vcd import get_vcd_timescale
from sub... | 0 | 0 | 0 | 0 | 0 | 16,982 | 0 | 146 | 473 |
ecf2ad1014ba580179cdf2f557a5ed584afa8446 | 3,595 | py | Python | vmaig_blog/urls.py | wangsure/czxs | e45e2ffde1597cb5a41d5fb46818805a1fa0d848 | [
"BSD-3-Clause"
] | null | null | null | vmaig_blog/urls.py | wangsure/czxs | e45e2ffde1597cb5a41d5fb46818805a1fa0d848 | [
"BSD-3-Clause"
] | null | null | null | vmaig_blog/urls.py | wangsure/czxs | e45e2ffde1597cb5a41d5fb46818805a1fa0d848 | [
"BSD-3-Clause"
] | null | null | null | from django.conf.urls import include, url
from django.contrib.sitemaps.views import sitemap
from django.contrib.sitemaps import GenericSitemap
from django.contrib import admin
from blog.models import Article, News, Category, Column
from demoproject import views
import xadmin;
xadmin.autodiscover();
from xadmin.plugi... | 37.447917 | 115 | 0.606954 | from django.conf.urls import include, url
from django.contrib.sitemaps.views import sitemap
from django.contrib.sitemaps import FlatPageSitemap, GenericSitemap, Sitemap
from django.core.urlresolvers import reverse
from django.contrib import admin
from blog.models import Article, News, Category, Column
from demoprojec... | 0 | 0 | 0 | 181 | 0 | 0 | 0 | 39 | 68 |
63789201d86443209329b9776585583fa421912b | 2,010 | py | Python | luigi/contrib/sparkey.py | shouldsee/luigi | 54a347361ae1031f06105eaf30ff88f5ef65b00c | [
"Apache-2.0"
] | 5 | 2015-02-26T18:52:56.000Z | 2017-07-07T05:47:18.000Z | luigi/contrib/sparkey.py | shouldsee/luigi | 54a347361ae1031f06105eaf30ff88f5ef65b00c | [
"Apache-2.0"
] | 9 | 2017-03-22T23:38:48.000Z | 2019-01-28T21:13:06.000Z | luigi/contrib/sparkey.py | shouldsee/luigi | 54a347361ae1031f06105eaf30ff88f5ef65b00c | [
"Apache-2.0"
] | 9 | 2015-01-26T14:47:57.000Z | 2020-07-07T17:01:25.000Z | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 31.40625 | 100 | 0.685075 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 0 | 0 | 0 | 1,329 | 0 | 0 | 0 | -9 | 46 |
ff451b4287664bcebaa07ec7328aecbf9cc1c8c2 | 2,639 | py | Python | epytope/Data/pssms/smm/mat/A_23_01_11.py | christopher-mohr/epytope | 8ac9fe52c0b263bdb03235a5a6dffcb72012a4fd | [
"BSD-3-Clause"
] | 7 | 2021-02-01T18:11:28.000Z | 2022-01-31T19:14:07.000Z | epytope/Data/pssms/smm/mat/A_23_01_11.py | christopher-mohr/epytope | 8ac9fe52c0b263bdb03235a5a6dffcb72012a4fd | [
"BSD-3-Clause"
] | 22 | 2021-01-02T15:25:23.000Z | 2022-03-14T11:32:53.000Z | epytope/Data/pssms/smm/mat/A_23_01_11.py | christopher-mohr/epytope | 8ac9fe52c0b263bdb03235a5a6dffcb72012a4fd | [
"BSD-3-Clause"
] | 4 | 2021-05-28T08:50:38.000Z | 2022-03-14T11:45:32.000Z | A_23_01_11 = {0: {'A': 0.076, 'C': 0.036, 'E': 0.046, 'D': -0.002, 'G': 0.043, 'F': -0.067, 'I': 0.002, 'H': 0.011, 'K': 0.104, 'M': -0.205, 'L': -0.209, 'N': -0.039, 'Q': 0.186, 'P': 0.065, 'S': 0.074, 'R': -0.03, 'T': 0.087, 'W': 0.0, 'V': -0.11, 'Y': -0.068}, 1: {'A': 0.014, 'C': 0.002, 'E': 0.031, 'D': -0.004, 'G':... | 2,639 | 2,639 | 0.360743 | A_23_01_11 = {0: {'A': 0.076, 'C': 0.036, 'E': 0.046, 'D': -0.002, 'G': 0.043, 'F': -0.067, 'I': 0.002, 'H': 0.011, 'K': 0.104, 'M': -0.205, 'L': -0.209, 'N': -0.039, 'Q': 0.186, 'P': 0.065, 'S': 0.074, 'R': -0.03, 'T': 0.087, 'W': 0.0, 'V': -0.11, 'Y': -0.068}, 1: {'A': 0.014, 'C': 0.002, 'E': 0.031, 'D': -0.004, 'G':... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8805847efb84b9182830f2db109cdf8df06405a3 | 727 | py | Python | echome/identity.py | mgtrrz/echome-python-sdk | c169510cb801ff3144cc746b96726cb2b535f9fd | [
"MIT"
] | 1 | 2022-01-31T19:35:14.000Z | 2022-01-31T19:35:14.000Z | echome/identity.py | mgtrrz/echome-python-sdk | c169510cb801ff3144cc746b96726cb2b535f9fd | [
"MIT"
] | 1 | 2021-09-26T01:40:30.000Z | 2021-09-26T01:40:30.000Z | echome/identity.py | mgtrrz/echome-python-sdk | c169510cb801ff3144cc746b96726cb2b535f9fd | [
"MIT"
] | null | null | null | import logging
logger = logging.getLogger(__name__)
| 29.08 | 61 | 0.661623 | import logging
from .resource import BaseResource
logger = logging.getLogger(__name__)
class Identity(BaseResource):
namespace = "identity/user"
def describe_all_users(self):
return self.request_url("/describe/all")
def describe_user(self, user_id:str):
return self.request_url(f"/des... | 0 | 0 | 0 | 616 | 0 | 0 | 0 | 13 | 45 |
e1d3533156e4de3f0f953303a7aa03e8959c6889 | 990 | py | Python | base/site-packages/jpush/push/audience.py | edisonlz/fastor | 342078a18363ac41d3c6b1ab29dbdd44fdb0b7b3 | [
"Apache-2.0"
] | 285 | 2019-12-23T09:50:21.000Z | 2021-12-08T09:08:49.000Z | base/site-packages/jpush/push/audience.py | jeckun/fastor | 342078a18363ac41d3c6b1ab29dbdd44fdb0b7b3 | [
"Apache-2.0"
] | null | null | null | base/site-packages/jpush/push/audience.py | jeckun/fastor | 342078a18363ac41d3c6b1ab29dbdd44fdb0b7b3 | [
"Apache-2.0"
] | 9 | 2019-12-23T12:59:25.000Z | 2022-03-15T05:12:11.000Z |
# Value selectors; aliases, tags, etc.
def tag(*tags):
"""Select a (list of) tag(s)."""
vtag = [t for t in tags]
return {"tag": vtag}
def tag_and(*tag_ands):
"""Select a (list of) tag_and(s)."""
vtag_and = [t for t in tag_ands]
return {"tag_and": vtag_and}
def tag_not(*tag_nots):
"""Sele... | 25.384615 | 48 | 0.611111 | import re
# Value selectors; aliases, tags, etc.
def tag(*tags):
"""Select a (list of) tag(s)."""
vtag = [t for t in tags]
return {"tag": vtag}
def tag_and(*tag_ands):
"""Select a (list of) tag_and(s)."""
vtag_and = [t for t in tag_ands]
return {"tag_and": vtag_and}
def tag_not(*tag_nots):
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -12 | 22 |
24ae06873ec69434dce877fd511455ca4e400e69 | 525 | py | Python | shop/migrations/0027_item_offer_price.py | Zex0n/django-simple-cms | 097098dcea218697a53f9c04005c86a7680ee4e1 | [
"MIT"
] | 1 | 2021-04-03T09:29:13.000Z | 2021-04-03T09:29:13.000Z | shop/migrations/0027_item_offer_price.py | Zex0n/django-simple-cms | 097098dcea218697a53f9c04005c86a7680ee4e1 | [
"MIT"
] | null | null | null | shop/migrations/0027_item_offer_price.py | Zex0n/django-simple-cms | 097098dcea218697a53f9c04005c86a7680ee4e1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2018-07-30 14:11
from __future__ import unicode_literals
| 25 | 126 | 0.64 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2018-07-30 14:11
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('shop', '0026_auto_20180716_1626'),
]
operations = [
migrations.AddField(
... | 26 | 0 | 0 | 333 | 0 | 0 | 0 | 19 | 46 |
1ace981d823bbe67c690c75ab2bed1f4bfa3b8f6 | 1,143 | py | Python | 2019-10-23-ex-11.py | mpassosbr/python3 | ff83f1f6f787206e49696134a99d68190606ed4f | [
"MIT"
] | null | null | null | 2019-10-23-ex-11.py | mpassosbr/python3 | ff83f1f6f787206e49696134a99d68190606ed4f | [
"MIT"
] | null | null | null | 2019-10-23-ex-11.py | mpassosbr/python3 | ff83f1f6f787206e49696134a99d68190606ed4f | [
"MIT"
] | null | null | null | num_vezes = 0
soma_total = 0
maior_numero = None
menor_numero = None
while True:
num = input("Digite um nmero ou \"sair\" para encerrar o programa: ")
if num == "sair":
break
try:
numero = int(num)
num_vezes += 1
soma_total += numero
if maior_numero is None or numero ... | 40.821429 | 126 | 0.648294 | num_vezes = 0
soma_total = 0
maior_numero = None
menor_numero = None
while True:
num = input("Digite um número ou \"sair\" para encerrar o programa: ")
if num == "sair":
break
try:
numero = int(num)
num_vezes += 1
soma_total += numero
if maior_numero is None or numero... | 32 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
89e8813cf7f6c8a6eea7821b86c6ff1ab918f535 | 5,124 | py | Python | cpix/filters.py | ArrisMultiTrust/pycpix | e250b113e8496c892a78d9a4a55f1c9a0886e4dd | [
"MIT"
] | 15 | 2018-09-25T14:52:04.000Z | 2022-03-01T13:37:38.000Z | cpix/filters.py | ArrisMultiTrust/pycpix | e250b113e8496c892a78d9a4a55f1c9a0886e4dd | [
"MIT"
] | null | null | null | cpix/filters.py | ArrisMultiTrust/pycpix | e250b113e8496c892a78d9a4a55f1c9a0886e4dd | [
"MIT"
] | 5 | 2019-02-19T10:58:59.000Z | 2021-02-01T03:46:56.000Z | """
Filter classes
"""
def encode_bool(value):
"""Encode booleans to produce valid XML"""
if value:
return "true"
return "false"
| 25.878788 | 78 | 0.583724 | """
Filter classes
"""
from . import etree
from .base import CPIXComparableBase
def encode_bool(value):
"""Encode booleans to produce valid XML"""
if value:
return "true"
return "false"
class KeyPeriodFilter(CPIXComparableBase):
"""
KeyPeriodFilter element
Has single required attribu... | 0 | 2,005 | 0 | 2,791 | 0 | 0 | 0 | 13 | 159 |
7ec647a60c71377740d89e88489c6c77a19977d5 | 1,001 | py | Python | Proyecto/Obtener El calendario/Correo.py | luisgerardoperalestorres/EstanciasI | 2d9add096919d9911a0d40ad8bcabce4f6a24b40 | [
"MIT"
] | null | null | null | Proyecto/Obtener El calendario/Correo.py | luisgerardoperalestorres/EstanciasI | 2d9add096919d9911a0d40ad8bcabce4f6a24b40 | [
"MIT"
] | null | null | null | Proyecto/Obtener El calendario/Correo.py | luisgerardoperalestorres/EstanciasI | 2d9add096919d9911a0d40ad8bcabce4f6a24b40 | [
"MIT"
] | null | null | null | import base64
import httplib2
from email.mime.text import MIMEText
from apiclient.discovery import build
from oauth2client.file import Storage
from oauth2client.tools import run_flow
from google_auth_oauthlib.flow import InstalledAppFlow
permiso = ['https://www.googleapis.com/auth/gmail.send']
memoria = Storage('gmai... | 34.517241 | 97 | 0.791209 | import base64
import httplib2
from email.mime.text import MIMEText
from apiclient.discovery import build
from oauth2client.client import flow_from_clientsecrets
from oauth2client.file import Storage
from oauth2client.tools import run_flow
from google_auth_oauthlib.flow import InstalledAppFlow
permiso = ['https://www.... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 34 | 22 |
e8d66f7590965688803098f582bdd62de5164810 | 1,760 | py | Python | zcmds/cmds/common/obs_organize.py | zackees/zcmds | 7868b078bc0a3489f0de8435c19f0c3c7913f50f | [
"MIT"
] | null | null | null | zcmds/cmds/common/obs_organize.py | zackees/zcmds | 7868b078bc0a3489f0de8435c19f0c3c7913f50f | [
"MIT"
] | null | null | null | zcmds/cmds/common/obs_organize.py | zackees/zcmds | 7868b078bc0a3489f0de8435c19f0c3c7913f50f | [
"MIT"
] | null | null | null | import os
import shutil
import traceback
HOME_DIR = os.path.abspath(os.path.expanduser("~"))
PATH_DEFAULT_OBS = os.path.join(HOME_DIR, "videos", "obs")
DRY_RUN = False
def _is_video_file(file_path: str) -> bool:
"""Returns True if the given file is a video file."""
_, ext = os.path.splitext(file_path.lower()... | 28.852459 | 112 | 0.599432 | import os
import shutil
import traceback
HOME_DIR = os.path.abspath(os.path.expanduser("~"))
PATH_DEFAULT_OBS = os.path.join(HOME_DIR, "videos", "obs")
DRY_RUN = False
def _is_video_file(file_path: str) -> bool:
"""Returns True if the given file is a video file."""
_, ext = os.path.splitext(file_path.lower()... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a004be6db5b89fa71ce5391401e2071c48d2e7ca | 276 | py | Python | Mundo1/aula8C.py | OliveiraVasconcelos/Python-CursoemVideo | bcca20d24b6af7bde9ce290b011cfa5abc0c1cc3 | [
"MIT"
] | null | null | null | Mundo1/aula8C.py | OliveiraVasconcelos/Python-CursoemVideo | bcca20d24b6af7bde9ce290b011cfa5abc0c1cc3 | [
"MIT"
] | null | null | null | Mundo1/aula8C.py | OliveiraVasconcelos/Python-CursoemVideo | bcca20d24b6af7bde9ce290b011cfa5abc0c1cc3 | [
"MIT"
] | null | null | null | import math
x = float(input('Digite um ngulo: '))
tangente = math.tan(math.radians(x))
cos = math.acos(math.radians(x))
seno = math.asin(math.radians(x))
print(f'O cosseno de {x} {cos:.2f}')
print(f'O seno de {x} {seno:.2f}')
print(f'A tangente de {x} {tangente:.2f}') | 34.5 | 45 | 0.65942 | import math
x = float(input('Digite um ângulo: '))
tangente = math.tan(math.radians(x))
cos = math.acos(math.radians(x))
seno = math.asin(math.radians(x))
print(f'O cosseno de {x} é {cos:.2f}')
print(f'O seno de {x} é {seno:.2f}')
print(f'A tangente de {x} é {tangente:.2f}') | 8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e2412a6280e8cd18645880fc44e80ad1de79dc52 | 2,482 | py | Python | recipes/Python/273844_Minimal_http_upload_cgi/recipe-273844.py | tdiprima/code | 61a74f5f93da087d27c70b2efe779ac6bd2a3b4f | [
"MIT"
] | 2,023 | 2017-07-29T09:34:46.000Z | 2022-03-24T08:00:45.000Z | recipes/Python/273844_Minimal_http_upload_cgi/recipe-273844.py | unhacker/code | 73b09edc1b9850c557a79296655f140ce5e853db | [
"MIT"
] | 32 | 2017-09-02T17:20:08.000Z | 2022-02-11T17:49:37.000Z | recipes/Python/273844_Minimal_http_upload_cgi/recipe-273844.py | unhacker/code | 73b09edc1b9850c557a79296655f140ce5e853db | [
"MIT"
] | 780 | 2017-07-28T19:23:28.000Z | 2022-03-25T20:39:41.000Z | #!/usr/local/bin/python
"""This demonstrates a minimal http upload cgi.
This allows a user to upload up to three files at once.
It is trivial to change the number of files uploaded.
This script has security risks. A user could attempt to fill
a disk partition with endless uploads.
If you have a system open to the pub... | 35.971014 | 82 | 0.699436 | #!/usr/local/bin/python
"""This demonstrates a minimal http upload cgi.
This allows a user to upload up to three files at once.
It is trivial to change the number of files uploaded.
This script has security risks. A user could attempt to fill
a disk partition with endless uploads.
If you have a system open to the pub... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
86c7c2703b64373394ab93187cb0ba9fcade85a4 | 16,837 | py | Python | tools/converter/integration.py | zypeh/utf8rewind | 46dd600a4716f80debbe4bbbe4a5b19daf0e2cb2 | [
"MIT"
] | 5 | 2021-02-07T08:19:59.000Z | 2021-11-18T01:17:01.000Z | tools/converter/integration.py | zypeh/utf8rewind | 46dd600a4716f80debbe4bbbe4a5b19daf0e2cb2 | [
"MIT"
] | 1 | 2020-05-25T08:59:35.000Z | 2020-05-25T14:59:09.000Z | tools/converter/integration.py | zypeh/utf8rewind | 46dd600a4716f80debbe4bbbe4a5b19daf0e2cb2 | [
"MIT"
] | 1 | 2020-06-06T10:30:33.000Z | 2020-06-06T10:30:33.000Z | import argparse
import unicodedata
import libs.header
import libs.unicode
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Parse Unicode codepoint database and write integration tests.')
parser.add_argument(
'-v', '--verbose',
dest = 'verbose',
action = 'store_true',
help =... | 28.440878 | 231 | 0.639247 | import argparse
import datetime
import os
import re
import sys
import unicodedata
import libs.header
import libs.unicode
import libs.utf8
def codepointToUnicode(codepoint):
return "U+%04X" % codepoint
class IntegrationSuite:
def __init__(self, db):
self.db = db
def open(self, filepath):
scr... | 0 | 0 | 0 | 14,908 | 0 | 43 | 0 | -46 | 440 |
abefb5b34cf7c2c8dc3c3cbfe3542add3720d435 | 803 | py | Python | notebooks/__code/__all/config_handler.py | mabrahamdevops/python_notebooks | 6d5e7383b60cc7fd476f6e85ab93e239c9c32330 | [
"BSD-3-Clause"
] | null | null | null | notebooks/__code/__all/config_handler.py | mabrahamdevops/python_notebooks | 6d5e7383b60cc7fd476f6e85ab93e239c9c32330 | [
"BSD-3-Clause"
] | null | null | null | notebooks/__code/__all/config_handler.py | mabrahamdevops/python_notebooks | 6d5e7383b60cc7fd476f6e85ab93e239c9c32330 | [
"BSD-3-Clause"
] | null | null | null | try:
from PyQt4.QtCore import QSettings
except ImportError:
| 24.333333 | 61 | 0.603985 | try:
from PyQt4.QtCore import QSettings
except ImportError:
from PyQt5.QtCore import QSettings
def init_config():
settings = QSettings('settings.ini', QSettings.IniFormat)
def save_config(key='', value='', group=''):
settings = QSettings('settings.ini')
if not (group == ''):
settin... | 0 | 0 | 0 | 0 | 0 | 614 | 0 | 13 | 107 |
0a8a2003d5158da4a6b7bb11a36556ab218b3b4b | 1,475 | py | Python | sila_library/sila2lib/fdl_parser/data_type_response.py | lemmi25/sila2lib | ac4db8ee7fe6c99bde498151a539b25be2021d2f | [
"MIT"
] | null | null | null | sila_library/sila2lib/fdl_parser/data_type_response.py | lemmi25/sila2lib | ac4db8ee7fe6c99bde498151a539b25be2021d2f | [
"MIT"
] | null | null | null | sila_library/sila2lib/fdl_parser/data_type_response.py | lemmi25/sila2lib | ac4db8ee7fe6c99bde498151a539b25be2021d2f | [
"MIT"
] | null | null | null | """
__________________________________________________________________________________________________
:project: SiLA2_python
:details: Response data type in a SiLA Command, Property, Intermediate, ...
:file: data_type_response.py
:authors: Timm Severin
:date: (creation) 20190820
:date: (last modificati... | 37.820513 | 120 | 0.772203 | """
__________________________________________________________________________________________________
:project: SiLA2_python
:details: Response data type in a SiLA Command, Property, Intermediate, ...
:file: data_type_response.py
:authors: Timm Severin
:date: (creation) 20190820
:date: (last modificati... | 0 | 0 | 0 | 588 | 0 | 0 | 0 | 29 | 45 |
5c9e3dccd4c10b46579b853910c08110a0cbf6bd | 1,939 | py | Python | full/api_reader.py | PythonDayMX/MLaaS | 3a109f1e83edabb4044c47e1cfa2a39c6227685c | [
"MIT"
] | 8 | 2018-11-30T05:05:10.000Z | 2021-04-05T07:02:53.000Z | full/api_reader.py | PythonDayMX/MLaaS | 3a109f1e83edabb4044c47e1cfa2a39c6227685c | [
"MIT"
] | null | null | null | full/api_reader.py | PythonDayMX/MLaaS | 3a109f1e83edabb4044c47e1cfa2a39c6227685c | [
"MIT"
] | 2 | 2018-11-30T17:09:05.000Z | 2018-11-30T19:20:05.000Z | # ===============================================================
# Author: Rodolfo Ferro
# Email: ferro@cimat.mx
# Twitter: @FerroRodolfo
#
# ABOUT COPYING OR USING PARTIAL INFORMATION:
# This script was originally created by Rodolfo Ferro, for
# his workshop in PythonDay Mexico 2018 at CUCEA in Gdl, Mx.
# Any explici... | 28.101449 | 77 | 0.598762 | # ===============================================================
# Author: Rodolfo Ferro
# Email: ferro@cimat.mx
# Twitter: @FerroRodolfo
#
# ABOUT COPYING OR USING PARTIAL INFORMATION:
# This script was originally created by Rodolfo Ferro, for
# his workshop in PythonDay Mexico 2018 at CUCEA in Gdl, Mx.
# Any explici... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -10 | 22 |
1647294741a7ef54149b7e1a9153b9c05311ea75 | 229 | py | Python | PyBullet_experiments/experiments/laber_sac_halfchee.py | AnonymousLaBER/LaBER | af9da8ffda0654e2021de20cb162ef71dc9b9d6c | [
"MIT"
] | 3 | 2021-10-11T22:25:02.000Z | 2022-03-04T20:00:56.000Z | PyBullet_experiments/experiments/laber_sac_halfchee.py | AnonymousLaBER/LaBER | af9da8ffda0654e2021de20cb162ef71dc9b9d6c | [
"MIT"
] | null | null | null | PyBullet_experiments/experiments/laber_sac_halfchee.py | AnonymousLaBER/LaBER | af9da8ffda0654e2021de20cb162ef71dc9b9d6c | [
"MIT"
] | null | null | null | from stable_baselines3 import SAC_LABER
model = SAC_LABER('MlpPolicy', 'HalfCheetahBulletEnv-v0', verbose=1, tensorboard_log="results/long_SAC_LABER_HalfCheetahBullet/")
model.learn(total_timesteps=3000000)
| 38.166667 | 129 | 0.847162 | import pybullet_envs
from stable_baselines3 import SAC_LABER
model = SAC_LABER('MlpPolicy', 'HalfCheetahBulletEnv-v0', verbose=1, tensorboard_log="results/long_SAC_LABER_HalfCheetahBullet/")
model.learn(total_timesteps=3000000)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | -1 | 22 |
f0ed52cc13fd5b72d59358509be5b900dc005beb | 8,030 | py | Python | testapplehealthdata.py | jclark017/applehealthdata | da825124011fa46f8309203b8a25b80ab5f062e8 | [
"MIT"
] | 56 | 2016-06-05T15:41:02.000Z | 2022-03-02T21:51:50.000Z | testapplehealthdata.py | jclark017/applehealthdata | da825124011fa46f8309203b8a25b80ab5f062e8 | [
"MIT"
] | 1 | 2021-12-30T14:06:18.000Z | 2021-12-30T14:06:18.000Z | testapplehealthdata.py | jclark017/applehealthdata | da825124011fa46f8309203b8a25b80ab5f062e8 | [
"MIT"
] | 21 | 2017-02-04T13:06:20.000Z | 2021-12-29T18:56:42.000Z | # -*- coding: utf-8 -*-
"""
testapplehealthdata.py: tests for the applehealthdata.py
Copyright (c) 2016 Nicholas J. Radcliffe
Licence: MIT
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import shutil
im... | 31.490196 | 76 | 0.573101 | # -*- coding: utf-8 -*-
"""
testapplehealthdata.py: tests for the applehealthdata.py
Copyright (c) 2016 Nicholas J. Radcliffe
Licence: MIT
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import re
import... | 6 | 141 | 0 | 5,901 | 0 | 0 | 0 | 121 | 113 |
afb0bae78a861d61cb7bff15ba2ae3ac74bd95d9 | 4,024 | py | Python | tests/test_books.py | FilippoPisello/Books-Read-DB | f68b33861dc66222d23d37b03e1abf1d9623c0ba | [
"MIT"
] | null | null | null | tests/test_books.py | FilippoPisello/Books-Read-DB | f68b33861dc66222d23d37b03e1abf1d9623c0ba | [
"MIT"
] | null | null | null | tests/test_books.py | FilippoPisello/Books-Read-DB | f68b33861dc66222d23d37b03e1abf1d9623c0ba | [
"MIT"
] | null | null | null | import unittest
if __name__ == "__main__":
unittest.main()
| 33.815126 | 87 | 0.582256 | import unittest
from datetime import date
from controller.books import Book, BookRead
class TestBooks(unittest.TestCase):
def setUp(self) -> None:
self.book1 = Book("Title", "Lorem", "Ipsum", 120, "Genre", False, None)
self.book2 = Book("title", "lorem", "ipsum", 120, "genre", True, ["Yes", "nO"]... | 0 | 0 | 0 | 3,840 | 0 | 0 | 0 | 26 | 91 |
ec861e6dda12fb8898b391b55324a0cbbdef264e | 1,973 | py | Python | ProjectDemo/scripts/test/threadScheduler.py | ryrynoryry/Immersive-Illumination | d0e28fc246850648ffc2eca81b0da3daed994d07 | [
"MIT"
] | null | null | null | ProjectDemo/scripts/test/threadScheduler.py | ryrynoryry/Immersive-Illumination | d0e28fc246850648ffc2eca81b0da3daed994d07 | [
"MIT"
] | null | null | null | ProjectDemo/scripts/test/threadScheduler.py | ryrynoryry/Immersive-Illumination | d0e28fc246850648ffc2eca81b0da3daed994d07 | [
"MIT"
] | null | null | null | import threading
import os.path
import time
from blueThread import MainBlue
# class myThread (threading.Thread):
# def __init__(self, threadID, name, counter):
# threading.Thread.__init__(self)
# self.threadID = threadID
# self.name = name
# self.counter = counter
# def run(self):
#... | 26.662162 | 105 | 0.583376 | import threading
import os.path
import time
from blueThread import MainBlue
# class myThread (threading.Thread):
# def __init__(self, threadID, name, counter):
# threading.Thread.__init__(self)
# self.threadID = threadID
# self.name = name
# self.counter = counter
# def run(self):
#... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7c24e0e7bd87da7dcf0d17237156e3ed8a9c914a | 682 | py | Python | packages/postgres-database/src/simcore_postgres_database/migration/versions/cfd1c43b5d33_migrate_workbench_state_enum.py | colinRawlings/osparc-simcore | bf2f18d5bc1e574d5f4c238d08ad15156184c310 | [
"MIT"
] | 25 | 2018-04-13T12:44:12.000Z | 2022-03-12T15:01:17.000Z | packages/postgres-database/src/simcore_postgres_database/migration/versions/cfd1c43b5d33_migrate_workbench_state_enum.py | colinRawlings/osparc-simcore | bf2f18d5bc1e574d5f4c238d08ad15156184c310 | [
"MIT"
] | 2,553 | 2018-01-18T17:11:55.000Z | 2022-03-31T16:26:40.000Z | packages/postgres-database/src/simcore_postgres_database/migration/versions/cfd1c43b5d33_migrate_workbench_state_enum.py | mrnicegyu11/osparc-simcore | b6fa6c245dbfbc18cc74a387111a52de9b05d1f4 | [
"MIT"
] | 20 | 2018-01-18T19:45:33.000Z | 2022-03-29T07:08:47.000Z | """migrate workbench state enum
Revision ID: cfd1c43b5d33
Revises: c8a7073deebb
Create Date: 2020-11-17 16:42:32.511722+00:00
"""
# revision identifiers, used by Alembic.
revision = 'cfd1c43b5d33'
down_revision = 'c8a7073deebb'
branch_labels = None
depends_on = None
| 19.485714 | 84 | 0.653959 | """migrate workbench state enum
Revision ID: cfd1c43b5d33
Revises: c8a7073deebb
Create Date: 2020-11-17 16:42:32.511722+00:00
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'cfd1c43b5d33'
down_revision = 'c8a7073deebb'
branch_labels = None
depends_on = None
... | 0 | 0 | 0 | 0 | 0 | 316 | 0 | 3 | 90 |
e0da0a1af0b2f9dd2f59c9caf104f7566ccc85e2 | 270 | py | Python | individual_work/justin/sandbox/build_alderman.py | marquettecomputationalsocialscience/clusteredcrimemaps | 4fb4ad1ad2474f854dabc1a72fbefcbb700d601a | [
"MIT"
] | 2 | 2017-11-16T23:22:53.000Z | 2018-02-05T21:04:03.000Z | individual_work/justin/sandbox/build_alderman.py | marquettecomputationalsocialscience/clusteredcrimemaps | 4fb4ad1ad2474f854dabc1a72fbefcbb700d601a | [
"MIT"
] | null | null | null | individual_work/justin/sandbox/build_alderman.py | marquettecomputationalsocialscience/clusteredcrimemaps | 4fb4ad1ad2474f854dabc1a72fbefcbb700d601a | [
"MIT"
] | 3 | 2017-08-06T22:44:45.000Z | 2018-10-28T02:11:56.000Z | import json
fn = open('../static/alderman.js', 'w')
#add alderman boundaries variable
json_file = open('../maps/alderman.geojson')
geo_json = json.load(json_file)
fn.write('var alderman_boundaries = ')
fn.write(json.dumps(geo_json))
fn.write(';\n\n')
json_file.close() | 24.545455 | 44 | 0.722222 | import json
fn = open('../static/alderman.js', 'w')
#add alderman boundaries variable
json_file = open('../maps/alderman.geojson')
geo_json = json.load(json_file)
fn.write('var alderman_boundaries = ')
fn.write(json.dumps(geo_json))
fn.write(';\n\n')
json_file.close() | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1685444ea08d378d0e2dd4b7a518820677952a30 | 5,760 | py | Python | heavymodel/tables.py | lewisfogden/heavymodel | 53507be8b7ce099740126d524f84e8cf84214995 | [
"MIT"
] | 3 | 2020-05-22T22:38:56.000Z | 2021-11-23T19:38:44.000Z | heavymodel/tables.py | lewisfogden/heavymodel | 53507be8b7ce099740126d524f84e8cf84214995 | [
"MIT"
] | 2 | 2020-05-23T21:08:22.000Z | 2020-07-10T21:35:06.000Z | heavymodel/tables.py | lewisfogden/heavymodel | 53507be8b7ce099740126d524f84e8cf84214995 | [
"MIT"
] | 2 | 2021-01-31T10:37:39.000Z | 2022-03-02T09:07:06.000Z | # tables.py
| 36.687898 | 129 | 0.485243 | # tables.py
class MortalityTable:
"""mortalitytable is a matrix, by age and duration."""
def __init__(self, csv_filename, name, select_period, pc_of_base=1):
self.filename = csv_filename
self.name = name
self.select_period = select_period
self.pc_of_base = pc_of_base... | 0 | 0 | 0 | 5,608 | 0 | 0 | 0 | 0 | 133 |
9c9bdde05fd6b005c418fb0f2df26af899a1b5ee | 457 | py | Python | pysimgame/utils/maths.py | ScienceGamez/pysimgame | 6c89280441358722efbc63b6d8aa914cbe21575e | [
"WTFPL"
] | null | null | null | pysimgame/utils/maths.py | ScienceGamez/pysimgame | 6c89280441358722efbc63b6d8aa914cbe21575e | [
"WTFPL"
] | null | null | null | pysimgame/utils/maths.py | ScienceGamez/pysimgame | 6c89280441358722efbc63b6d8aa914cbe21575e | [
"WTFPL"
] | null | null | null | """Mathematical helper functions."""
def normalize(array):
"""Normalize the array.
Set all the values betwwen 0 and 1.
0 corresponds to the min value and 1 the max.
If the normalization cannot occur, will return the array.
"""
min_ = min(array)
max_ = max(array)
return (
(arra... | 25.388889 | 62 | 0.601751 | """Mathematical helper functions."""
def normalize(array):
"""Normalize the array.
Set all the values betwwen 0 and 1.
0 corresponds to the min value and 1 the max.
If the normalization cannot occur, will return the array.
"""
min_ = min(array)
max_ = max(array)
return (
(arra... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1767230b91ddc9a5770836dbc0935ed70a2e4b8d | 105 | py | Python | files/Strings/d25.py | heltonricardo/estudo-python | e82eb8ebc15378175b03d367a6eeea66e8858cff | [
"MIT"
] | null | null | null | files/Strings/d25.py | heltonricardo/estudo-python | e82eb8ebc15378175b03d367a6eeea66e8858cff | [
"MIT"
] | null | null | null | files/Strings/d25.py | heltonricardo/estudo-python | e82eb8ebc15378175b03d367a6eeea66e8858cff | [
"MIT"
] | null | null | null | nome = input('Insira nome completo: ').strip()
print('Possui "Silva"?', 'silva' in nome.lower())
input()
| 26.25 | 49 | 0.657143 | nome = input('Insira nome completo: ').strip()
print('Possui "Silva"?', 'silva' in nome.lower())
input()
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
de22e77706673d86f80049a8a5df73132c478cf4 | 5,266 | py | Python | models/resnet.py | akanametov/classification-pytorch | 1090d6e794a789150c3e8f0f68080dd208d340c1 | [
"MIT"
] | null | null | null | models/resnet.py | akanametov/classification-pytorch | 1090d6e794a789150c3e8f0f68080dd208d340c1 | [
"MIT"
] | null | null | null | models/resnet.py | akanametov/classification-pytorch | 1090d6e794a789150c3e8f0f68080dd208d340c1 | [
"MIT"
] | null | null | null | import torch.nn as nn
__all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101', 'resnet152']
def conv3x3(in_planes, out_planes, **kwargs):
"""3x3 convolution with padding"""
kwargs['kernel_size'] = 3
kwargs['padding'] = 1
kwargs['bias'] = False
return nn.Conv2d(in_planes, out_planes, *... | 30.616279 | 96 | 0.590201 | import torch
import torch.nn as nn
__all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101', 'resnet152']
def conv3x3(in_planes, out_planes, **kwargs):
"""3x3 convolution with padding"""
kwargs['kernel_size'] = 3
kwargs['padding'] = 1
kwargs['bias'] = False
return nn.Conv2d(in_planes, ... | 0 | 0 | 0 | 4,059 | 0 | 0 | 0 | -9 | 99 |
b9fcee270a8071595b5e1f5162f790c169294d8f | 3,537 | py | Python | database.py | shikanon/sota-website | 3a49fe5e91de72a5d7c7a07ce8b76637953c8194 | [
"MIT"
] | null | null | null | database.py | shikanon/sota-website | 3a49fe5e91de72a5d7c7a07ce8b76637953c8194 | [
"MIT"
] | null | null | null | database.py | shikanon/sota-website | 3a49fe5e91de72a5d7c7a07ce8b76637953c8194 | [
"MIT"
] | null | null | null | #coding:utf-8
| 34.009615 | 125 | 0.615493 | #coding:utf-8
import pymongo
import records
class DB:
def __init__(self):
''' 初始化数据库
'''
self.init_mongo()
self.init_record()
def init_mongo(self):
# mongodb客户端
mongo_client = pymongo.MongoClient('mongodb://10.10.6.85:27017/')
api_db = mongo_client["sot... | 330 | 0 | 0 | 3,359 | 0 | 0 | 0 | -14 | 67 |
36557163a13310fca57cbdee6a3ecf79cac43fbc | 27,785 | py | Python | tm351_nb_utils.py | innovationOUtside/notebook_processing | 7444235112c2c0677f0873db54f080138c78ad95 | [
"MIT"
] | 2 | 2020-02-12T06:34:03.000Z | 2021-09-30T04:55:10.000Z | tm351_nb_utils.py | innovationOUtside/notebook_processing | 7444235112c2c0677f0873db54f080138c78ad95 | [
"MIT"
] | 8 | 2020-07-04T21:35:31.000Z | 2022-01-10T17:13:40.000Z | tm351_nb_utils.py | innovationOUtside/notebook_processing | 7444235112c2c0677f0873db54f080138c78ad95 | [
"MIT"
] | null | null | null | # ou-tm351 - `nb_pub_utils`
#GOTCHA - Python on Mac logging in to Github: https://stackoverflow.com/a/42098127/454773
import click
import os
import shutil
import zipfile
import datetime
import github
from tabulate import tabulate
from shlex import quote
def listify(item):
''' If presented with a string and a l... | 44.670418 | 272 | 0.633831 | # ou-tm351 - `nb_pub_utils`
#GOTCHA - Python on Mac logging in to Github: https://stackoverflow.com/a/42098127/454773
import click
import os
import shutil
import zipfile
import humanize
import datetime
import github
from tabulate import tabulate
from shlex import quote
import subprocess
def cli_command(cmd):
t... | 2 | 10,494 | 0 | 0 | 0 | 1,166 | 0 | 9 | 371 |
9753d7bfd9a6580628e5db08bdd5fcda2b36ed62 | 42,974 | py | Python | plots/instrument_plot.py | shaunwbell/EcoFOCI_MooringAnalysis | 369617cac20b41c1606aeac83fbd9131b77e1c15 | [
"MIT"
] | 3 | 2017-03-23T16:52:44.000Z | 2022-03-08T16:53:29.000Z | plots/instrument_plot.py | shaunwbell/EcoFOCI_MooringAnalysis | 369617cac20b41c1606aeac83fbd9131b77e1c15 | [
"MIT"
] | 43 | 2017-04-03T23:12:52.000Z | 2022-01-28T16:04:34.000Z | plots/instrument_plot.py | shaunwbell/EcoFOCI_MooringAnalysis | 369617cac20b41c1606aeac83fbd9131b77e1c15 | [
"MIT"
] | 2 | 2017-03-30T22:01:25.000Z | 2019-10-17T17:30:29.000Z | #!/usr/bin/env
"""
class definitions for standard 1 variable plots
class definitions for standard 2 variable plots
class definitions for standard 3 variable plots
History:
--------
2019-05-21: error in calculation used corrected udata to correct vdata
"""
# System Stack
# science stack
# Visual Stack
import ... | 36.635976 | 119 | 0.588472 | #!/usr/bin/env
"""
class definitions for standard 1 variable plots
class definitions for standard 2 variable plots
class definitions for standard 3 variable plots
History:
--------
2019-05-21: error in calculation used corrected udata to correct vdata
"""
# System Stack
import datetime
# science stack
import n... | 0 | 8,719 | 0 | 33,443 | 0 | 0 | 0 | 119 | 295 |
1e8a2fa776f5bd96393450257a891c27824bdb82 | 14,904 | py | Python | tests/test_interactions/test_omit_interactions.py | radifar/PyPLIF-HIPPOS | 95fc5dd81b900e84ae6f3368c4b70a08d17257dd | [
"HPND"
] | 13 | 2020-07-29T12:19:56.000Z | 2022-02-07T04:48:19.000Z | tests/test_interactions/test_omit_interactions.py | radifar/PyPLIF-HIPPOS | 95fc5dd81b900e84ae6f3368c4b70a08d17257dd | [
"HPND"
] | 5 | 2021-03-30T01:11:49.000Z | 2021-09-13T11:49:35.000Z | tests/test_interactions/test_omit_interactions.py | radifar/PyPLIF-HIPPOS | 95fc5dd81b900e84ae6f3368c4b70a08d17257dd | [
"HPND"
] | 5 | 2020-08-06T07:26:06.000Z | 2021-10-30T17:16:39.000Z | """
The tests for omit interaction feature
"""
import os
import sys
from pyplif_hippos import ParseConfig, hippos, similarity
def test_configuration_single_omit_interaction(tmpdir):
"""Test configuration for omitting specific interaction"""
# Arrange
config_file = tmpdir.mkdir("sub").join("config.txt"... | 39.638298 | 495 | 0.790526 | """
The tests for omit interaction feature
"""
import os
import sys
from collections import namedtuple
from pyplif_hippos import ParseConfig, hippos, similarity
def test_configuration_single_omit_interaction(tmpdir):
"""Test configuration for omitting specific interaction"""
# Arrange
config_file = t... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 13 | 23 |
18b43d93d77ebe67e06100b1f3fc186f79af79fd | 3,413 | py | Python | lib/demucs_service.py | avillalobos/demucs_service | 0ef2c45983620cd9522a5953387ec19662283456 | [
"MIT"
] | 2 | 2021-03-05T11:25:23.000Z | 2022-01-03T19:42:28.000Z | lib/demucs_service.py | avillalobos/demucs_service | 0ef2c45983620cd9522a5953387ec19662283456 | [
"MIT"
] | null | null | null | lib/demucs_service.py | avillalobos/demucs_service | 0ef2c45983620cd9522a5953387ec19662283456 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import sys
from lib.demucs import demucs
from lib.demucs.demucs import model
# within the demucs directory
sys.modules['demucs.model'] = model
sys.modules['demucs'] = demucs
| 36.698925 | 79 | 0.612364 | #!/usr/bin/python3
import sys
from lib.demucs import demucs
from lib.demucs.demucs import model
from lib.demucs.demucs.audio import AudioFile
from lib.demucs.demucs.utils import apply_model, load_model
from pathlib import Path
from scipy.io import wavfile
# within the demucs directory
sys.modules['demucs.model'] = ... | 0 | 0 | 0 | 3,032 | 0 | 0 | 0 | 72 | 111 |
781b2eb6394e77875786319670d0805d9e8efe89 | 596 | py | Python | 100days/day80/query_demo.py | chainren/python-learn | 5e48e96c4bb212806b9ae0954fdb368abdcf9ba3 | [
"Apache-2.0"
] | null | null | null | 100days/day80/query_demo.py | chainren/python-learn | 5e48e96c4bb212806b9ae0954fdb368abdcf9ba3 | [
"Apache-2.0"
] | 16 | 2020-02-12T03:09:30.000Z | 2022-03-12T00:08:59.000Z | 100days/day80/query_demo.py | chainren/python-learn | 5e48e96c4bb212806b9ae0954fdb368abdcf9ba3 | [
"Apache-2.0"
] | null | null | null | import pymysql
conn = pymysql.Connection(
host = '192.168.160.33',
port = 3306,
user = 'develop',
password='xs_dev',
database='test',
charset='utf8'
)
cursor = conn.cursor()
sql = """
select * from user1
"""
try:
cursor.execute(sql)
res = cursor.fetchall()
for row in res:
... | 18.060606 | 103 | 0.553691 | import pymysql
conn = pymysql.Connection(
host = '192.168.160.33',
port = 3306,
user = 'develop',
password='xs_dev',
database='test',
charset='utf8'
)
cursor = conn.cursor()
sql = """
select * from user1
"""
try:
cursor.execute(sql)
res = cursor.fetchall()
for row in res:
... | 12 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
22bac7328f5707f686d5d1081d9a304673121b3f | 2,245 | py | Python | nfmanagementapi/resources/ServiceObjectCollectionResource.py | nfirewall/nfmapi | 7232975711ad01b031ed50d7f26936afcfe5312a | [
"MIT"
] | null | null | null | nfmanagementapi/resources/ServiceObjectCollectionResource.py | nfirewall/nfmapi | 7232975711ad01b031ed50d7f26936afcfe5312a | [
"MIT"
] | null | null | null | nfmanagementapi/resources/ServiceObjectCollectionResource.py | nfirewall/nfmapi | 7232975711ad01b031ed50d7f26936afcfe5312a | [
"MIT"
] | null | null | null |
path = 'service_objects'
endpoint = 'service_objects'
| 29.155844 | 72 | 0.561247 | from nfmanagementapi.models import ServiceObject
from nfmanagementapi.schemata import ServiceObjectSchema
from marshmallow.exceptions import ValidationError
from .BaseResource import BaseResource
from flask import request
from app import db
from uuid import uuid4
path = 'service_objects'
endpoint = 'service_objects'
... | 0 | 0 | 0 | 1,903 | 0 | 0 | 0 | 110 | 177 |
0e99d00e9c38f4e19afb900ddb0a47445848a8c2 | 3,824 | py | Python | code/EthicAssessmentSoftware/migrations/0001_initial.py | FelixOliverLange/ethikbackend | 3fd2ad6c2953966254841fb770b482c7f7741791 | [
"BSD-3-Clause"
] | null | null | null | code/EthicAssessmentSoftware/migrations/0001_initial.py | FelixOliverLange/ethikbackend | 3fd2ad6c2953966254841fb770b482c7f7741791 | [
"BSD-3-Clause"
] | 2 | 2021-06-10T20:36:01.000Z | 2021-09-22T19:44:05.000Z | code/EthicAssessmentSoftware/migrations/0001_initial.py | FelixOliverLange/ethikbackend | 3fd2ad6c2953966254841fb770b482c7f7741791 | [
"BSD-3-Clause"
] | null | null | null | # Generated by Django 3.1.6 on 2021-02-12 00:15
| 50.986667 | 138 | 0.599895 | # Generated by Django 3.1.6 on 2021-02-12 00:15
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Anwendung',
fields=[
... | 0 | 0 | 0 | 3,677 | 0 | 0 | 0 | 30 | 68 |
b0c7f1929a58731db1dd66c0222e1c9b375dbf86 | 1,339 | py | Python | old/v1/config_v1.py | apollo-heidal/Sound-Synth | c392291ee83d391333acaaff7ff3448da758bdbb | [
"MIT"
] | null | null | null | old/v1/config_v1.py | apollo-heidal/Sound-Synth | c392291ee83d391333acaaff7ff3448da758bdbb | [
"MIT"
] | null | null | null | old/v1/config_v1.py | apollo-heidal/Sound-Synth | c392291ee83d391333acaaff7ff3448da758bdbb | [
"MIT"
] | null | null | null | config = {
"frequency": 440.0,
"duration": 20.0,
"sampling_rate": 44100,
"filename": "test_v1.wav",
"overtones": [
[
440.0,
1.0
],
[
12447.350408741928,
0.1098108639573242
],
[
12465.35... | 17.853333 | 33 | 0.285288 | config = {
"frequency": 440.0,
"duration": 20.0,
"sampling_rate": 44100,
"filename": "test_v1.wav",
"overtones": [
[
440.0,
1.0
],
[
12447.350408741928,
0.1098108639573242
],
[
12465.35... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
66cc98c8d9319502ca072034ba7112b3f7e1b2f6 | 67,679 | py | Python | pyspectools/ftmw_analysis.py | aowen-uwmad/PySpecTools | 3fd0b68352910df1e653370797a8edd46d92fa1c | [
"MIT"
] | 22 | 2018-03-14T10:44:17.000Z | 2022-01-10T15:02:37.000Z | pyspectools/ftmw_analysis.py | aowen-uwmad/PySpecTools | 3fd0b68352910df1e653370797a8edd46d92fa1c | [
"MIT"
] | 21 | 2019-07-27T01:43:50.000Z | 2021-11-15T14:57:15.000Z | pyspectools/ftmw_analysis.py | aowen-uwmad/PySpecTools | 3fd0b68352910df1e653370797a8edd46d92fa1c | [
"MIT"
] | 3 | 2020-08-03T16:22:00.000Z | 2021-11-01T15:31:55.000Z | import datetime
import re
from itertools import combinations
import pandas as pd
import numpy as np
import peakutils
from scipy import signal as spsig
def parse_spectrum(filename, threshold=20.0):
""" Function to read in a blackchirp or QtFTM spectrum from file """
dataframe = pd.read_csv(
filename,... | 37.516075 | 120 | 0.576604 | import datetime
import re
import os
import struct
from dataclasses import dataclass, field
from itertools import combinations, product
from typing import List, Dict
import pandas as pd
import numpy as np
import peakutils
from matplotlib import pyplot as plt
from scipy import signal as spsig
import plotly.graph_objs as... | 0 | 33,976 | 0 | 14,947 | 0 | 2,400 | 0 | 165 | 515 |
2d8767d69cb3fe7dd0333a69a100b095f51eda10 | 942 | py | Python | week4_divide_and_conquer/4_number_of_inversions/inversions.py | thegautamkumarjaiswal/Algorithm-s_ToolBox_Solutions | bb265647ed183f44e0d56f14a4b8b966af73dfd2 | [
"Apache-2.0"
] | null | null | null | week4_divide_and_conquer/4_number_of_inversions/inversions.py | thegautamkumarjaiswal/Algorithm-s_ToolBox_Solutions | bb265647ed183f44e0d56f14a4b8b966af73dfd2 | [
"Apache-2.0"
] | null | null | null | week4_divide_and_conquer/4_number_of_inversions/inversions.py | thegautamkumarjaiswal/Algorithm-s_ToolBox_Solutions | bb265647ed183f44e0d56f14a4b8b966af73dfd2 | [
"Apache-2.0"
] | null | null | null | # python3
""" Task: Count the number of inversions of a given sequence """
tot_count = 0
n = int ( input () )
seq = [ int ( i ) for i in input ().split () ]
mergesort ( seq )
print ( tot_count )
| 21.409091 | 64 | 0.505308 | # python3
""" Task: Count the number of inversions of a given sequence """
def merge(left , right) :
i , j , inversion_counter = 0 , 0 , 0
final = list ()
while i < len ( left ) and j < len ( right ) :
if left [ i ] <= right [ j ] :
final.append ( left [ i ] )
i += 1
... | 0 | 0 | 0 | 0 | 0 | 696 | 0 | 0 | 46 |
7672fabf7a8b7a3f323dedbf8df709a757105afa | 3,646 | py | Python | py3/tflib/lsun256.py | fr42k/gap-wgan-gp | 4e373c43d606a1b83f76893d93f9cf8be8cd460d | [
"MIT"
] | null | null | null | py3/tflib/lsun256.py | fr42k/gap-wgan-gp | 4e373c43d606a1b83f76893d93f9cf8be8cd460d | [
"MIT"
] | null | null | null | py3/tflib/lsun256.py | fr42k/gap-wgan-gp | 4e373c43d606a1b83f76893d93f9cf8be8cd460d | [
"MIT"
] | null | null | null | import numpy as np
import scipy.misc
import os
import time
# from PIL import Image
DATA_DIR = '/home/ubuntu/lsun/bedrooms/'
NEW_DATA_DIR = '/home/ubuntu/lsun/bedrooms_128/'
# with open(DATA_DIR+'files.txt', 'r') as f:
# files = [l[:-1] for l in f]
# # images = np.zeros((batch_size, 3, 256, 256), dtype='int32')
# ... | 36.828283 | 133 | 0.507131 | import numpy as np
import scipy.misc
import os
import time
# from PIL import Image
DATA_DIR = '/home/ubuntu/lsun/bedrooms/'
NEW_DATA_DIR = '/home/ubuntu/lsun/bedrooms_128/'
# with open(DATA_DIR+'files.txt', 'r') as f:
# files = [l[:-1] for l in f]
# # images = np.zeros((batch_size, 3, 256, 256), dtype='int32')
# ... | 0 | 0 | 0 | 0 | 1,458 | 0 | 0 | 0 | 23 |
52f33d0f97e1c3d24a976315266ee6737b9b34db | 14,048 | py | Python | tests/cron_job_tests/test_genomic_data_quality_pipeline.py | all-of-us/raw-data-repository | d28ad957557587b03ff9c63d55dd55e0508f91d8 | [
"BSD-3-Clause"
] | 39 | 2017-10-13T19:16:27.000Z | 2021-09-24T16:58:21.000Z | tests/cron_job_tests/test_genomic_data_quality_pipeline.py | all-of-us/raw-data-repository | d28ad957557587b03ff9c63d55dd55e0508f91d8 | [
"BSD-3-Clause"
] | 312 | 2017-09-08T15:42:13.000Z | 2022-03-23T18:21:40.000Z | tests/cron_job_tests/test_genomic_data_quality_pipeline.py | all-of-us/raw-data-repository | d28ad957557587b03ff9c63d55dd55e0508f91d8 | [
"BSD-3-Clause"
] | 19 | 2017-09-15T13:58:00.000Z | 2022-02-07T18:33:20.000Z | # Tests for the Genomics Data Quality Pipeline
| 42.313253 | 105 | 0.670487 | # Tests for the Genomics Data Quality Pipeline
import mock, datetime, pytz
from rdr_service import clock
from rdr_service.api_util import open_cloud_file
from rdr_service.genomic_enums import GenomicJob, GenomicSubProcessStatus, GenomicSubProcessResult, \
GenomicManifestTypes, GenomicIncidentCode
from tests.helper... | 0 | 3,234 | 0 | 10,223 | 0 | 0 | 0 | 317 | 224 |
431ef6db152840abe39b59d1b1a27606e88c65d6 | 716 | py | Python | Tried/Strings/1237.py | LorranSutter/URI-Online-Judge | aef885b9a7caa83484cf172e29eea8ec92fc3627 | [
"MIT"
] | null | null | null | Tried/Strings/1237.py | LorranSutter/URI-Online-Judge | aef885b9a7caa83484cf172e29eea8ec92fc3627 | [
"MIT"
] | null | null | null | Tried/Strings/1237.py | LorranSutter/URI-Online-Judge | aef885b9a7caa83484cf172e29eea8ec92fc3627 | [
"MIT"
] | null | null | null | # Time limit exceeded
while True:
try:
A = input()
B = input()
lA = len(A)
lB = len(B)
biggest = ""
shortest = ""
lshortest = 0
if max(lA, lB) == lA:
biggest, shortest = A, B
lbiggest = lA
lshortest = lB
else:
biggest, shortest = B, A
lbiggest = lB
lshortest = lA
bSub = 0
c... | 14.916667 | 35 | 0.539106 | # Time limit exceeded
while True:
try:
A = input()
B = input()
lA = len(A)
lB = len(B)
biggest = ""
shortest = ""
lshortest = 0
if max(lA, lB) == lA:
biggest, shortest = A, B
lbiggest = lA
lshortest = lB
else:
biggest, shortest = B, A
lbiggest = lB
lshortest = lA
bSub = 0
c... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
32ed63da26a1030fea2213fe16ac945a18313b1b | 1,490 | py | Python | galvatron_lib/core/location_handlers/chrome_handler.py | viking333/galvatron | c2dc9c94ad64e79ad234c4a04b039f6cf429e0f3 | [
"MIT"
] | null | null | null | galvatron_lib/core/location_handlers/chrome_handler.py | viking333/galvatron | c2dc9c94ad64e79ad234c4a04b039f6cf429e0f3 | [
"MIT"
] | null | null | null | galvatron_lib/core/location_handlers/chrome_handler.py | viking333/galvatron | c2dc9c94ad64e79ad234c4a04b039f6cf429e0f3 | [
"MIT"
] | 7 | 2019-08-22T15:17:44.000Z | 2020-01-03T17:18:06.000Z | priority = 1
| 37.25 | 230 | 0.672483 | import os, urllib, requests, json
priority = 1
def get_extension_id(arg1):
package = "\"{}\"".format(arg1.replace("chrome://", ""))
package = urllib.quote_plus(package)
url = "https://chrome.google.com/webstore/ajax/item?hl=en&gl=GB&pv=20181009&count=2&searchTerm={}".format(package)
resp = requests.po... | 0 | 0 | 0 | 0 | 0 | 1,351 | 0 | 12 | 114 |
eb509f37c00b60320a88eccf0074acfe172aadc6 | 124 | py | Python | Code/lecture 17/code6_list.py | capacitybuilding/Introduction-to-Computng | 77639e53ed53896581c4a8431f32198237ac70dc | [
"MIT"
] | null | null | null | Code/lecture 17/code6_list.py | capacitybuilding/Introduction-to-Computng | 77639e53ed53896581c4a8431f32198237ac70dc | [
"MIT"
] | null | null | null | Code/lecture 17/code6_list.py | capacitybuilding/Introduction-to-Computng | 77639e53ed53896581c4a8431f32198237ac70dc | [
"MIT"
] | null | null | null |
list1 = [1, 4, 8, 2, 9]
print len(list1)
print max(list1), min(list1)
print list1[-2]
print list1[-5:3]
print list1[-3:]
| 12.4 | 28 | 0.629032 |
list1 = [1, 4, 8, 2, 9]
print len(list1)
print max(list1), min(list1)
print list1[-2]
print list1[-5:3]
print list1[-3:]
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
698015ddf789237819b0eaa04da727793abc9f2a | 2,079 | py | Python | plot/histogram.py | IvoryLu/data-processing | 65d91537dea777d037e9a419a355a0c8493aa19c | [
"BSD-3-Clause"
] | null | null | null | plot/histogram.py | IvoryLu/data-processing | 65d91537dea777d037e9a419a355a0c8493aa19c | [
"BSD-3-Clause"
] | null | null | null | plot/histogram.py | IvoryLu/data-processing | 65d91537dea777d037e9a419a355a0c8493aa19c | [
"BSD-3-Clause"
] | null | null | null | from matplotlib import pyplot as plt
from script import sales_times1
from script import sales_times2
# normed=True This command divides the height of each column by
# a constant such that the total shaded area of the histogram sums
# to 1
plt.hist(sales_times1, bins=20, alpha=0.4, normed=True)
plt.hist(sales_times2, b... | 36.473684 | 259 | 0.721501 | from matplotlib import pyplot as plt
from script import sales_times1
from script import sales_times2
# normed=True This command divides the height of each column by
# a constant such that the total shaded area of the histogram sums
# to 1
plt.hist(sales_times1, bins=20, alpha=0.4, normed=True)
plt.hist(sales_times2, b... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9f18495a49f1afc15c2ebfbfac14e88650c4cc8b | 214 | py | Python | basico/aula002/aula02.py | KaicPierre/Curso-de-Python3 | 6267ba92c298f0ffa103e374615f040b0db13339 | [
"MIT"
] | 1 | 2020-09-04T07:46:45.000Z | 2020-09-04T07:46:45.000Z | basico/aula002/aula02.py | KaicPierre/Curso-de-Python3 | 6267ba92c298f0ffa103e374615f040b0db13339 | [
"MIT"
] | null | null | null | basico/aula002/aula02.py | KaicPierre/Curso-de-Python3 | 6267ba92c298f0ffa103e374615f040b0db13339 | [
"MIT"
] | null | null | null | # print(123456)
# print('Kaic', 'Pierre', 'Outra Coisa')
# print('Kaic', 'Pierre', sep='-', end='')
# print('Testando', 'Outras', 'Coisas', sep='-', end='')
print('428', '330', '048', sep='.', end='-')
print('93')
| 30.571429 | 56 | 0.537383 | # print(123456)
# print('Kaic', 'Pierre', 'Outra Coisa')
# print('Kaic', 'Pierre', sep='-', end='')
# print('Testando', 'Outras', 'Coisas', sep='-', end='')
print('428', '330', '048', sep='.', end='-')
print('93')
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6dda831cadd31c8f32d1dc02a292c613ee99c7ef | 6,245 | py | Python | voc_classifier/bert_model.py | myeonghak/kobert-multi-label-VOC-classifier | 983524e8331b5e833d85779dfe7521c21bf2d1cd | [
"Apache-2.0"
] | 6 | 2021-08-18T00:52:38.000Z | 2021-12-03T12:37:18.000Z | voc_classifier/bert_model.py | myeonghak/kobert-multi-label-VOC-classifier | 983524e8331b5e833d85779dfe7521c21bf2d1cd | [
"Apache-2.0"
] | null | null | null | voc_classifier/bert_model.py | myeonghak/kobert-multi-label-VOC-classifier | 983524e8331b5e833d85779dfe7521c21bf2d1cd | [
"Apache-2.0"
] | 1 | 2022-03-24T08:02:44.000Z | 2022-03-24T08:02:44.000Z | import sys
sys.path.append("../")
# KoBERT
import config
import torch
import torch.optim as optim
import gluonnlp as nlp
from KoBERT.kobert.utils import get_tokenizer
from KoBERT.kobert.pytorch_kobert import get_pytorch_kobert_model
# from transformers.optimization import WarmupLinearSchedule
device = torch.dev... | 36.098266 | 151 | 0.63699 | import sys
sys.path.append("../")
# KoBERT 모델
import config
import pandas as pd
import numpy as np
from sklearn.preprocessing import OneHotEncoder
import torch
from torch import nn
import torch.nn.functional as F
import torch.optim as optim
from torch.utils.data import Dataset, DataLoader
import gluonnlp as nlp
fro... | 1,167 | 0 | 0 | 4,781 | 0 | 0 | 0 | 116 | 270 |
47c13dd4c0d747a6ab363ae514e4d9c517553a49 | 48 | py | Python | week1/logical1.py | pkoarmy/Learning-Python | 79067de3c09240d26939ca23ec98e96304660e7c | [
"MIT"
] | null | null | null | week1/logical1.py | pkoarmy/Learning-Python | 79067de3c09240d26939ca23ec98e96304660e7c | [
"MIT"
] | null | null | null | week1/logical1.py | pkoarmy/Learning-Python | 79067de3c09240d26939ca23ec98e96304660e7c | [
"MIT"
] | null | null | null | A = True
B = False
print(A and B)
print(A or B)
| 9.6 | 14 | 0.625 | A = True
B = False
print(A and B)
print(A or B)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
49326b7f76171a6e4c3018363dc191db9d2b6e72 | 8,565 | py | Python | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/pygsl/gsl_function.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 1 | 2019-07-29T02:53:51.000Z | 2019-07-29T02:53:51.000Z | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/pygsl/gsl_function.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 1 | 2021-09-11T14:30:32.000Z | 2021-09-11T14:30:32.000Z | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/pygsl/gsl_function.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 2 | 2016-12-19T02:27:46.000Z | 2019-07-29T02:53:54.000Z | #!/usr/bin/env python
# Author : Pierre Schnizer
"""
Collection of Callbacks systems for pygsl. They follow the GSL definitions as
close as possible. Instead os a struct python classes are used.
All solvers accept a C void pointer, which is passed to the callback. In Pygsl
this is an abitrary python object. See the... | 26.682243 | 79 | 0.585873 | #!/usr/bin/env python
# Author : Pierre Schnizer
"""
Collection of Callbacks systems for pygsl. They follow the GSL definitions as
close as possible. Instead os a struct python classes are used.
All solvers accept a C void pointer, which is passed to the callback. In Pygsl
this is an abitrary python object. See the... | 0 | 0 | 0 | 7,892 | 0 | 0 | 0 | 2 | 283 |
25348b308d580d2c34e6c0dbc12c85b434a6ba49 | 441 | py | Python | d05/main.py | burk3/aoc2020 | 541d6102276978ea5e4e7abbd25a8811268be148 | [
"MIT"
] | null | null | null | d05/main.py | burk3/aoc2020 | 541d6102276978ea5e4e7abbd25a8811268be148 | [
"MIT"
] | null | null | null | d05/main.py | burk3/aoc2020 | 541d6102276978ea5e4e7abbd25a8811268be148 | [
"MIT"
] | null | null | null |
if __name__ == "__main__":
main() | 20.045455 | 61 | 0.562358 | import argparse
def to_n(s: str) -> int:
s = s.replace("F", "0").replace("B", "1")
s = s.replace("L", "0").replace("R", "1")
return int(s, base=2)
def main():
parser = argparse.ArgumentParser()
parser.add_argument("input", type=argparse.FileType("r"))
args = parser.parse_args()
r = 0
... | 0 | 0 | 0 | 0 | 0 | 339 | 0 | -6 | 68 |
f7651a1cc1b8afbcfdaaac06947975fdaeb6345c | 1,128 | py | Python | Bio-StrongHold/src/Creating_a_Restriction_Map.py | crf1111/Bio-Informatics-Learning | 2ccc02d7a23584c12aee44c5620160cdcaf70bd4 | [
"MIT"
] | 1 | 2018-10-10T19:03:52.000Z | 2018-10-10T19:03:52.000Z | Bio-StrongHold/src/Creating_a_Restriction_Map.py | crf1111/Bio-Informatics-Learning | 2ccc02d7a23584c12aee44c5620160cdcaf70bd4 | [
"MIT"
] | null | null | null | Bio-StrongHold/src/Creating_a_Restriction_Map.py | crf1111/Bio-Informatics-Learning | 2ccc02d7a23584c12aee44c5620160cdcaf70bd4 | [
"MIT"
] | null | null | null | from collections import Counter
def partial_digest(distances):
'''Returns a set whose positive pairwise differences generate 'distances'.'''
# Initialize variables.
X = {0}
width = max(distances)
# Create lambda functions for multiset operations.
new_dist = lambda y, S: Counter(abs(y-s) for s... | 26.857143 | 81 | 0.606383 | from collections import Counter
def partial_digest(distances):
'''Returns a set whose positive pairwise differences generate 'distances'.'''
# Initialize variables.
X = {0}
width = max(distances)
# Create lambda functions for multiset operations.
new_dist = lambda y, S: Counter(abs(y-s) for s... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5249edbb51e3631d816de207fdd0682d7f1d7da4 | 1,291 | py | Python | exercises/exercise_10_25_16.py | JSBCCA/pythoncode | b7f2af8b0efc2d01d3e4568265eb3a5038a8679f | [
"MIT"
] | null | null | null | exercises/exercise_10_25_16.py | JSBCCA/pythoncode | b7f2af8b0efc2d01d3e4568265eb3a5038a8679f | [
"MIT"
] | null | null | null | exercises/exercise_10_25_16.py | JSBCCA/pythoncode | b7f2af8b0efc2d01d3e4568265eb3a5038a8679f | [
"MIT"
] | null | null | null |
if __name__ == '__main__':
text = input("Give words: ")
print(pig_latin(text))
| 35.861111 | 74 | 0.459334 | def pig_latin(text_input):
final = "" # create final string, couples, and split text_input
couples = ['bl', 'br', 'ch', 'cl', 'cr', 'dr', 'fl', 'fr', 'gh', 'gl',
'gr', 'ph', 'pl', 'pr', 'qu', 'sh', 'sk', 'sl', 'sm', 'sn',
'sp', 'st', 'sw', 'th', 'tr', 'tw', 'wh', 'wr']
split_t... | 0 | 0 | 0 | 0 | 0 | 1,180 | 0 | 0 | 22 |
8a17fe6998c6e108cf61b5bc941dda0925aaff14 | 5,144 | py | Python | North Pacific/PacificTimestepDensities.py | OceanParcels/SKIM-garbagepatchlocations | 3c028e3ceba902ff79f52e31b83bed811bde1133 | [
"MIT"
] | 1 | 2021-07-13T12:55:20.000Z | 2021-07-13T12:55:20.000Z | North Pacific/PacificTimestepDensities.py | OceanParcels/SKIM-garbagepatchlocations | 3c028e3ceba902ff79f52e31b83bed811bde1133 | [
"MIT"
] | null | null | null | North Pacific/PacificTimestepDensities.py | OceanParcels/SKIM-garbagepatchlocations | 3c028e3ceba902ff79f52e31b83bed811bde1133 | [
"MIT"
] | 1 | 2022-02-28T14:03:13.000Z | 2022-02-28T14:03:13.000Z | # -*- coding: utf-8 -*-
"""
Created on Wed Aug 15 13:35:23 2018
@author: Victor Onink
Here we create a figure that has the 24h, and the 3h flow field densities
for the North Pacific
"""
import numpy as np
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
from scipy import io
import pandas as pd... | 43.965812 | 108 | 0.666796 | # -*- coding: utf-8 -*-
"""
Created on Wed Aug 15 13:35:23 2018
@author: Victor Onink
Here we create a figure that has the 24h, and the 3h flow field densities
for the North Pacific
"""
import numpy as np
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
from scipy import io
import pandas as pd... | 0 | 0 | 0 | 0 | 0 | 3,294 | 0 | 0 | 118 |
abd35021221bc3bef34a47edf3e936e59ef5dd0a | 1,563 | py | Python | openduty/settings_environment.py | pataquets/openduty | 5604e22b6a1aec7406ccd94ab2c17c1a6abd56c7 | [
"MIT"
] | null | null | null | openduty/settings_environment.py | pataquets/openduty | 5604e22b6a1aec7406ccd94ab2c17c1a6abd56c7 | [
"MIT"
] | 2 | 2020-07-18T18:13:51.000Z | 2020-07-18T18:14:43.000Z | openduty/settings_environment.py | pataquets/openduty | 5604e22b6a1aec7406ccd94ab2c17c1a6abd56c7 | [
"MIT"
] | 3 | 2016-10-24T17:36:00.000Z | 2018-04-30T18:07:51.000Z |
BASE_URL = os.getenv('OPENDUTY_BASE_URL', "http://localhost")
XMPP_SETTINGS = {
'user': os.getenv('OPENDUTY_XMPP_USER'),
'password': os.getenv('OPENDUTY_XMPP_PASS'),
'server': os.getenv('OPENDUTY_XMPP_SERVER', 'xmpp'),
'port': os.getenv('OPENDUTY_XMPP_PORT', 5222),
}
EMAIL_SETTINGS = {
'user': o... | 27.421053 | 84 | 0.676903 | from settings import *
BASE_URL = os.getenv('OPENDUTY_BASE_URL', "http://localhost")
XMPP_SETTINGS = {
'user': os.getenv('OPENDUTY_XMPP_USER'),
'password': os.getenv('OPENDUTY_XMPP_PASS'),
'server': os.getenv('OPENDUTY_XMPP_SERVER', 'xmpp'),
'port': os.getenv('OPENDUTY_XMPP_PORT', 5222),
}
EMAIL_SET... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 22 |
6df353ed1986cfdd80127c2f8b54ef1714e4f5d8 | 1,313 | py | Python | NaiveBayes/src/test.py | quqixun/MLAlgorithms | 1ad46a899a6280a08c196fb4eb0931408c8636c7 | [
"MIT"
] | 2 | 2018-04-25T18:00:28.000Z | 2018-08-08T09:39:18.000Z | NaiveBayes/src/test.py | quqixun/MLAlgorithms | 1ad46a899a6280a08c196fb4eb0931408c8636c7 | [
"MIT"
] | null | null | null | NaiveBayes/src/test.py | quqixun/MLAlgorithms | 1ad46a899a6280a08c196fb4eb0931408c8636c7 | [
"MIT"
] | 2 | 2019-03-03T02:55:48.000Z | 2021-01-21T04:50:46.000Z | # Conventional Machine Learning Algorithms
# Test Script for Class of "NaiveBayes".
# Author: Qixun Qu
# Create on: 2018/04/24
# Modify on: 2018/04/25
# ,,, ,,,
# ;" '; ;' ",
# ; @.ss$$$$$$s.@ ;
# `s$$$$$$$$$$$$$$$'
# $$$$$$$$$$$$$$$$$$
# $$$$P""Y$$$Y""W$$$$$
# $$$$ p"$$$"q $$$$$
# $... | 24.314815 | 65 | 0.603199 | # Conventional Machine Learning Algorithms
# Test Script for Class of "NaiveBayes".
# Author: Qixun Qu
# Create on: 2018/04/24
# Modify on: 2018/04/25
# ,,, ,,,
# ;" '; ;' ",
# ; @.ss$$$$$$s.@ ;
# `s$$$$$$$$$$$$$$$'
# $$$$$$$$$$$$$$$$$$
# $$$$P""Y$$$Y""W$$$$$
# $$$$ p"$$$"q $$$$$
# $... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 45 |
192178a5c7c75105a3ee01c6e1f52067461ee41b | 2,921 | py | Python | login_script.py | ThBlitz/Minecraft-Packet-Mapper-MPM- | a2583574d176b57df341ee3eb023b1f29f0f1183 | [
"MIT"
] | null | null | null | login_script.py | ThBlitz/Minecraft-Packet-Mapper-MPM- | a2583574d176b57df341ee3eb023b1f29f0f1183 | [
"MIT"
] | null | null | null | login_script.py | ThBlitz/Minecraft-Packet-Mapper-MPM- | a2583574d176b57df341ee3eb023b1f29f0f1183 | [
"MIT"
] | null | null | null | from DataTypes import Packet, A_Packet_Class
from DataTypes import VarInt, Output_Streamer, Bytes_Streamer, Socket_Streamer
import time
output = Output_Streamer()
input = Bytes_Streamer()
login_packets = A_Packet_Class()
SOCK = Socket_Streamer('connect.2b2t.org', 25565, login_packets)
handshake = Packet(login_pac... | 20.716312 | 78 | 0.740157 | from Bridge import Proxy2Server
import os
from DataTypes import Packet, A_Packet_Class
from DataTypes import VarInt, Output_Streamer, Bytes_Streamer, Socket_Streamer
import time
output = Output_Streamer()
input = Bytes_Streamer()
login_packets = A_Packet_Class()
SOCK = Socket_Streamer('connect.2b2t.org', 25565, lo... | 0 | 0 | 0 | 0 | 0 | 264 | 0 | -2 | 90 |
fe59772b65a640da95a676113cf3e37dc12af265 | 4,836 | py | Python | src/data_analysis/analyze_goodreads_reviews_cleaned.py | ejgenc/data-analysis_goodreads_translation_reviews | c00dc7b59d5e3295df89d080e7d49792c15fa760 | [
"MIT"
] | 1 | 2021-09-04T15:11:20.000Z | 2021-09-04T15:11:20.000Z | src/data_analysis/analyze_goodreads_reviews_cleaned.py | ejgenc/data-analysis_goodreads_translation_reviews | c00dc7b59d5e3295df89d080e7d49792c15fa760 | [
"MIT"
] | null | null | null | src/data_analysis/analyze_goodreads_reviews_cleaned.py | ejgenc/data-analysis_goodreads_translation_reviews | c00dc7b59d5e3295df89d080e7d49792c15fa760 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed Mar 17 13:35:39 2021
@author: ejgen
------ What is this file? ------
This script targets the files goodreads_reviews_cleaned.csv and
review_sentences_analyzed.csv, calculating summary statistics such as
review length and sentiment score.
This script targets the following f... | 38.07874 | 81 | 0.580645 | # -*- coding: utf-8 -*-
"""
Created on Wed Mar 17 13:35:39 2021
@author: ejgen
------ What is this file? ------
This script targets the files goodreads_reviews_cleaned.csv and
review_sentences_analyzed.csv, calculating summary statistics such as
review length and sentiment score.
This script targets the following f... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
14d38902ff34fd61ae460246a58b5f14f1a88d4b | 2,614 | py | Python | save_face.py | idea4good/ReadFace | 0482befcfe6e2d232cae87fd9802aa80d037c907 | [
"Apache-2.0"
] | 2 | 2018-10-13T10:42:04.000Z | 2020-05-13T03:49:54.000Z | save_face.py | idea4good/ReadFace | 0482befcfe6e2d232cae87fd9802aa80d037c907 | [
"Apache-2.0"
] | 1 | 2018-05-03T06:09:21.000Z | 2018-05-07T09:51:35.000Z | save_face.py | idea4good/ReadFace | 0482befcfe6e2d232cae87fd9802aa80d037c907 | [
"Apache-2.0"
] | null | null | null | import cv2
import tensorflow as tf
from face_filter import c_face_filter
from mtcnn_detect import c_MTCNNDetect
from face_attr import c_face_attr_reader
standard_face_size = 160 # 160(weight) * 160(height)
detect_resolution = 80 # 80(weight) * 80(height)
the_face_attrs_reader = c_face_attr_reader(standard_face_size)... | 39.014925 | 121 | 0.594109 | import cv2, json, sys, datetime
import tensorflow as tf
import numpy as np
from face_filter import c_face_filter
from mtcnn_detect import c_MTCNNDetect
from face_attr import c_face_attr_reader
standard_face_size = 160 # 160(weight) * 160(height)
detect_resolution = 80 # 80(weight) * 80(height)
def record_single_face... | 0 | 0 | 0 | 0 | 0 | 2,014 | 0 | 18 | 45 |
d5bd8672c6fe31af95abb4e2bcd7359d4196917f | 15,661 | py | Python | otp/level/LevelSpec.py | AnonymousDeveloper65535/open-toontown | 3d05c22a7d960ad843dde231140447c46973dba5 | [
"BSD-3-Clause"
] | 8 | 2017-10-10T11:41:01.000Z | 2021-02-23T12:55:47.000Z | otp/level/LevelSpec.py | AnonymousDeveloper65535/open-toontown | 3d05c22a7d960ad843dde231140447c46973dba5 | [
"BSD-3-Clause"
] | 1 | 2018-07-28T20:07:04.000Z | 2018-07-30T18:28:34.000Z | otp/level/LevelSpec.py | AnonymousDeveloper65535/open-toontown | 3d05c22a7d960ad843dde231140447c46973dba5 | [
"BSD-3-Clause"
] | 2 | 2019-04-06T16:18:23.000Z | 2021-02-25T06:25:01.000Z | if __dev__:
| 37.023641 | 162 | 0.534066 | from pandac import PandaModules as PM
from direct.directnotify import DirectNotifyGlobal
from direct.showbase.PythonUtil import list2dict, uniqueElements
import string
import LevelConstants
import types
if __dev__:
import os
class LevelSpec:
notify = DirectNotifyGlobal.directNotify.newCategory('LevelSpec')
... | 0 | 0 | 0 | 15,409 | 0 | 0 | 0 | 59 | 181 |
8612134a84d546ccb13eba2fcebd4f7f0b9a3940 | 6,349 | py | Python | grantTempAdmin.py | hoyle-ub/MakeMeAdminPy | 9a674fb829b1a83e9f6e61436d36fd0b13897196 | [
"BSD-3-Clause"
] | null | null | null | grantTempAdmin.py | hoyle-ub/MakeMeAdminPy | 9a674fb829b1a83e9f6e61436d36fd0b13897196 | [
"BSD-3-Clause"
] | null | null | null | grantTempAdmin.py | hoyle-ub/MakeMeAdminPy | 9a674fb829b1a83e9f6e61436d36fd0b13897196 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Copyright (c) 2017 Jamf. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions a... | 49.217054 | 133 | 0.556466 | #!/usr/bin/env python
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Copyright (c) 2017 Jamf. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions a... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8d63061f1915c19b1edccebd546ba851e25c34a5 | 86 | py | Python | boj/10930.py | JeongHoLim/practice | 5f8914ba42b2ae01e0a00e92a7af9fcf63c8b7c2 | [
"MIT"
] | 1 | 2022-01-16T19:57:28.000Z | 2022-01-16T19:57:28.000Z | boj/10930.py | JeongHoLim/practice | 5f8914ba42b2ae01e0a00e92a7af9fcf63c8b7c2 | [
"MIT"
] | null | null | null | boj/10930.py | JeongHoLim/practice | 5f8914ba42b2ae01e0a00e92a7af9fcf63c8b7c2 | [
"MIT"
] | null | null | null | import hashlib
message = input()
print(hashlib.sha256(message.encode()).hexdigest()) | 17.2 | 51 | 0.755814 | import hashlib
message = input()
print(hashlib.sha256(message.encode()).hexdigest()) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
29f85f52ee9b12989c3c1794431c329b04a4a16a | 2,127 | py | Python | my_app/migrations/0001_initial.py | B0und/kotanima_server | 01b25531de219d16831d97a76c7e5f6326b6e99d | [
"MIT"
] | 1 | 2021-10-03T20:20:22.000Z | 2021-10-03T20:20:22.000Z | my_app/migrations/0001_initial.py | Kotanima/kotanima_server | 01b25531de219d16831d97a76c7e5f6326b6e99d | [
"MIT"
] | null | null | null | my_app/migrations/0001_initial.py | Kotanima/kotanima_server | 01b25531de219d16831d97a76c7e5f6326b6e99d | [
"MIT"
] | null | null | null | # Generated by Django 3.1.6 on 2021-04-17 11:19
| 42.54 | 147 | 0.586272 | # Generated by Django 3.1.6 on 2021-04-17 11:19
import django.contrib.postgres.fields
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='RedditPost',
fields=[... | 0 | 0 | 0 | 1,975 | 0 | 0 | 0 | 35 | 68 |
37a24d22cb3598933be530ff93291dd60b3d68a5 | 5,591 | py | Python | PyStationB/libraries/ABEX/tests/test_generic_parsing.py | BrunoKM/station-b-libraries | ea3591837e4a33f0bef789d905467754c27913b3 | [
"MIT"
] | 6 | 2021-09-29T15:46:55.000Z | 2021-12-14T18:39:51.000Z | PyStationB/libraries/ABEX/tests/test_generic_parsing.py | BrunoKM/station-b-libraries | ea3591837e4a33f0bef789d905467754c27913b3 | [
"MIT"
] | null | null | null | PyStationB/libraries/ABEX/tests/test_generic_parsing.py | BrunoKM/station-b-libraries | ea3591837e4a33f0bef789d905467754c27913b3 | [
"MIT"
] | 3 | 2021-09-27T10:35:20.000Z | 2021-10-02T17:53:07.000Z | # ------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
# -------------------------------------------------------------------... | 43.341085 | 111 | 0.636738 | # ------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
# -------------------------------------------------------------------... | 0 | 594 | 0 | 1,279 | 0 | 160 | 0 | 48 | 185 |
1cfd6c15d5a97dcc496e4cf4e6fa21334efe7b93 | 1,873 | py | Python | sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/virtual_network_configuration_py3.py | tzhanl/azure-sdk-for-python | 18cd03f4ab8fd76cc0498f03e80fbc99f217c96e | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/virtual_network_configuration_py3.py | tzhanl/azure-sdk-for-python | 18cd03f4ab8fd76cc0498f03e80fbc99f217c96e | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/virtual_network_configuration_py3.py | tzhanl/azure-sdk-for-python | 18cd03f4ab8fd76cc0498f03e80fbc99f217c96e | [
"MIT"
] | 1 | 2019-06-17T22:18:23.000Z | 2019-06-17T22:18:23.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 38.22449 | 171 | 0.623065 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 0 | 0 | 0 | 1,336 | 0 | 0 | 0 | 17 | 46 |
7fd3683a28de92b0f6f5f6203676d99dc6051d1a | 1,289 | py | Python | django/app_website/views.py | a-rey/aaronmreyes_heroku | f397741ec33a35c318b6e4d51837b352183085f9 | [
"MIT"
] | 1 | 2022-03-12T22:23:44.000Z | 2022-03-12T22:23:44.000Z | django/app_website/views.py | a-rey/docker_website | f397741ec33a35c318b6e4d51837b352183085f9 | [
"MIT"
] | 2 | 2020-04-07T22:09:50.000Z | 2020-04-07T22:09:50.000Z | django/app_website/views.py | a-rey/docker_website | f397741ec33a35c318b6e4d51837b352183085f9 | [
"MIT"
] | null | null | null | import django.shortcuts
def main(request):
"""
request handler for '/'.
"""
return django.shortcuts.render(request, 'app_website/index.html', {})
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# global error handlers for app_website
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~... | 23.87037 | 79 | 0.582622 | import django.shortcuts
def main(request):
"""
request handler for '/'.
"""
return django.shortcuts.render(request, 'app_website/index.html', {})
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# global error handlers for app_website
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
28bef48c033a719579453f4084bb87df283e7408 | 13,037 | py | Python | ansible/lib/ansible/module_utils/netcfg.py | kiv-box/kafka | debec1c4bc8c43776070ee447a53b55fef42bd52 | [
"Apache-2.0"
] | null | null | null | ansible/lib/ansible/module_utils/netcfg.py | kiv-box/kafka | debec1c4bc8c43776070ee447a53b55fef42bd52 | [
"Apache-2.0"
] | null | null | null | ansible/lib/ansible/module_utils/netcfg.py | kiv-box/kafka | debec1c4bc8c43776070ee447a53b55fef42bd52 | [
"Apache-2.0"
] | null | null | null | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | 31.490338 | 92 | 0.554192 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | 0 | 152 | 0 | 8,868 | 0 | 1,964 | 0 | 49 | 274 |
14401b26c4f2699577a5a8de47556e68420e2570 | 3,923 | py | Python | streamdeck.py | the-gearheads/StreamDeck | 616d06e28c0e79093507a656a6972a916ab17fc7 | [
"MIT"
] | null | null | null | streamdeck.py | the-gearheads/StreamDeck | 616d06e28c0e79093507a656a6972a916ab17fc7 | [
"MIT"
] | null | null | null | streamdeck.py | the-gearheads/StreamDeck | 616d06e28c0e79093507a656a6972a916ab17fc7 | [
"MIT"
] | null | null | null | import os
import threading
import time
from networktables import NetworkTables
from StreamDeck.DeviceManager import DeviceManager
ASSETS_PATH = os.path.join(os.path.dirname(__file__), "assets")
ASSETS_PATH = os.path.join(os.path.dirname(__file__), "icons")
# As a client to connect to a robot
NetworkTables.in... | 25.640523 | 81 | 0.624522 | import os
import threading
import time
from networktables import NetworkTables
from PIL import Image
from PIL.ImageColor import getcolor, getrgb
from PIL.ImageOps import grayscale
from StreamDeck.DeviceManager import DeviceManager
from StreamDeck.ImageHelpers import PILHelper
ASSETS_PATH = os.path.join(os.path.dirna... | 0 | 0 | 0 | 750 | 0 | 1,241 | 0 | 59 | 180 |
873966cecd914fb9e587a731142d35c5dac67b39 | 9,649 | py | Python | _curry.py | GoNZooo/dragonfly-grammars | 22d639d8f86f4f5a7c44caa73e75c4938c0ce199 | [
"MIT"
] | 3 | 2020-09-06T10:40:19.000Z | 2020-09-29T20:39:52.000Z | _curry.py | GoNZooo/dragonfly-grammars | 22d639d8f86f4f5a7c44caa73e75c4938c0ce199 | [
"MIT"
] | null | null | null | _curry.py | GoNZooo/dragonfly-grammars | 22d639d8f86f4f5a7c44caa73e75c4938c0ce199 | [
"MIT"
] | null | null | null | from dragonfly import (Grammar)
comparison_choice_map = {
"equal": "==",
"not equal": "/=",
"less or equal": "<=",
"greater or equal": ">=",
"less": "<",
"greater": ">",
}
stack_command_choice_map = {
"build fast": "build --fast",
"build": "build",
"shell"... | 31.025723 | 96 | 0.635092 | from dragonfly import (Grammar, CompoundRule, Text, MappingRule, Dictation, Function, Choice)
from macro_utilities import (replace_in_text, comment_choice, execute_with_dictation)
from vim.rules.letter import (camel_case, proper)
class CurryEnabler(CompoundRule):
spec = "enable Curry"
def _process_recognitio... | 0 | 0 | 0 | 2,688 | 0 | 5,345 | 0 | 154 | 688 |
3bbe192c0bd0ecce276a3a5226d771eca7a1f92d | 712 | py | Python | updatorr/__init__.py | idlesign/deluge-updatorr | aa7c5b0a312fdef580c8dd263760d48f3ac2a56e | [
"BSD-3-Clause"
] | 14 | 2015-02-24T21:50:06.000Z | 2022-01-17T07:51:35.000Z | updatorr/__init__.py | idlesign/deluge-updatorr | aa7c5b0a312fdef580c8dd263760d48f3ac2a56e | [
"BSD-3-Clause"
] | 1 | 2016-07-07T05:15:37.000Z | 2016-07-07T05:50:56.000Z | updatorr/__init__.py | idlesign/deluge-updatorr | aa7c5b0a312fdef580c8dd263760d48f3ac2a56e | [
"BSD-3-Clause"
] | 4 | 2015-04-27T10:47:23.000Z | 2019-01-08T02:53:18.000Z |
VERSION = (0, 1, 8)
| 25.428571 | 54 | 0.714888 | from deluge.plugins.init import PluginInitBase
VERSION = (0, 1, 8)
class CorePlugin(PluginInitBase):
def __init__(self, plugin_name):
from core import Core as _plugin_cls
self._plugin_cls = _plugin_cls
super(CorePlugin, self).__init__(plugin_name)
class GtkUIPlugin(PluginInitBase):
... | 0 | 0 | 0 | 571 | 0 | 0 | 0 | 25 | 91 |
18263fc551610af8df9f1b2b30108a9e0d99788f | 993 | py | Python | applications/users/views/profile.py | arielcalzadadeveloper/django-base-project | 6e6b8d4f25f45d76f34633f38eaec8d4880130ea | [
"MIT"
] | null | null | null | applications/users/views/profile.py | arielcalzadadeveloper/django-base-project | 6e6b8d4f25f45d76f34633f38eaec8d4880130ea | [
"MIT"
] | null | null | null | applications/users/views/profile.py | arielcalzadadeveloper/django-base-project | 6e6b8d4f25f45d76f34633f38eaec8d4880130ea | [
"MIT"
] | null | null | null |
Profile = ProfileCBV.as_view()
| 31.03125 | 89 | 0.769386 | from django.shortcuts import reverse
from django.views.generic import UpdateView
from applications.users.forms.profile import ProfileForm
from applications.users.layouts.profile import ProfileLayout
from applications.users.mixins.authenticated import AuthenticatedMixin
from applications.common.mixins.add_message impor... | 0 | 0 | 0 | 517 | 0 | 0 | 0 | 264 | 178 |
eadbb2d6d149a0b57c452f236114b2ae0e66a136 | 9,334 | py | Python | app/main/video/video.py | BorrowHome/flasky-sandbox | 70ef7aa087a0954f7ff4b4845f6599d8481ef0b1 | [
"Apache-2.0"
] | 1 | 2021-03-15T02:59:13.000Z | 2021-03-15T02:59:13.000Z | app/main/video/video.py | BorrowHome/flasky-sandbox | 70ef7aa087a0954f7ff4b4845f6599d8481ef0b1 | [
"Apache-2.0"
] | 6 | 2021-03-19T09:49:44.000Z | 2022-03-12T00:10:14.000Z | app/main/video/video.py | BorrowHome/flasky-sandbox | 70ef7aa087a0954f7ff4b4845f6599d8481ef0b1 | [
"Apache-2.0"
] | 2 | 2020-01-11T13:39:22.000Z | 2020-07-02T03:57:43.000Z | # -*- coding: utf-8 -*-
# INFO 2019/12/25 15:18 liliangbin
# TODO 2020/1/4 15:13 liliangbin
# TODO 2020/6/12 15:50 liliangbin
# INFO 2020/6/12 15:51 liliangbin
| 35.9 | 117 | 0.607028 | # -*- coding: utf-8 -*-
import csv
import os
import cv2
import numpy as np
from flask import render_template, request, redirect, url_for
from flask import jsonify
from app.main import main
from app.utils.frame.frame import base64_to_png
from app.utils.frame.site import Site
from app.utils.frame.sub import PictureSub
... | 1,308 | 8,230 | 0 | 0 | 0 | 0 | 0 | 68 | 423 |
ec9fd9597bdca1b68870394bf77473afe8484e61 | 233 | py | Python | lfs/manage/discounts/forms.py | naro/django-lfs | 312404370e497d00aa0f7221dc55a70a20490fb5 | [
"BSD-3-Clause"
] | null | null | null | lfs/manage/discounts/forms.py | naro/django-lfs | 312404370e497d00aa0f7221dc55a70a20490fb5 | [
"BSD-3-Clause"
] | null | null | null | lfs/manage/discounts/forms.py | naro/django-lfs | 312404370e497d00aa0f7221dc55a70a20490fb5 | [
"BSD-3-Clause"
] | null | null | null | # django imports
# lfs imports
| 16.642857 | 41 | 0.690987 | # django imports
from django.forms import ModelForm
# lfs imports
from lfs.discounts.models import Discount
class DiscountForm(ModelForm):
"""
Form to manage discount data.
"""
class Meta:
model = Discount
| 0 | 0 | 0 | 100 | 0 | 0 | 0 | 33 | 67 |
161fc216cd97b68346d08db33a110ef3a04fb9bd | 5,738 | py | Python | betka/utils.py | phracek/betka | 12c920bd76d33f81bbf8cda6f27d673c8826cf9e | [
"MIT"
] | 1 | 2020-11-05T21:16:28.000Z | 2020-11-05T21:16:28.000Z | betka/utils.py | phracek/betka | 12c920bd76d33f81bbf8cda6f27d673c8826cf9e | [
"MIT"
] | 16 | 2020-03-20T11:23:27.000Z | 2022-03-08T17:09:11.000Z | betka/utils.py | phracek/betka | 12c920bd76d33f81bbf8cda6f27d673c8826cf9e | [
"MIT"
] | 1 | 2020-03-11T09:29:48.000Z | 2020-03-11T09:29:48.000Z | # MIT License
#
# Copyright (c) 2020 SCL team at Red Hat
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify,... | 32.788571 | 89 | 0.66626 | # MIT License
#
# Copyright (c) 2020 SCL team at Red Hat
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify,... | 0 | 233 | 0 | 0 | 0 | 109 | 0 | 17 | 113 |
7f019039c93471670011b52c66c98041328e2ea4 | 2,848 | py | Python | deepspeech/io/collator.py | iclementine/DeepSpeech | d0635c6592a2e787ca296e15241e7371a83ca55f | [
"Apache-2.0"
] | 1 | 2021-05-14T23:27:13.000Z | 2021-05-14T23:27:13.000Z | deepspeech/io/collator.py | xihuanafeng/DeepSpeech | 2bdf4c946af66cc173d638c072ba6435cd18a286 | [
"Apache-2.0"
] | null | null | null | deepspeech/io/collator.py | xihuanafeng/DeepSpeech | 2bdf4c946af66cc173d638c072ba6435cd18a286 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 36.050633 | 86 | 0.61236 | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 0 | 0 | 0 | 1,997 | 0 | 0 | 0 | 50 | 90 |
c7c5f6d1f99a696768cc8b80c7193f77e06c25f7 | 28,956 | py | Python | lib/vclib/svn/svn_ra.py | cmanley/viewvc | 18ce398586ff99ee13ac64f85c205efdf9c23bad | [
"BSD-2-Clause"
] | null | null | null | lib/vclib/svn/svn_ra.py | cmanley/viewvc | 18ce398586ff99ee13ac64f85c205efdf9c23bad | [
"BSD-2-Clause"
] | null | null | null | lib/vclib/svn/svn_ra.py | cmanley/viewvc | 18ce398586ff99ee13ac64f85c205efdf9c23bad | [
"BSD-2-Clause"
] | null | null | null | # -*-python-*-
#
# Copyright (C) 1999-2018 The ViewCVS Group. All Rights Reserved.
#
# By using this file, you agree to the terms and conditions set forth in
# the LICENSE.html file which can be found at the top level of the ViewVC
# distribution or at http://viewvc.org/license-1.html.
#
# For more information, visit h... | 36.285714 | 79 | 0.645738 | # -*-python-*-
#
# Copyright (C) 1999-2018 The ViewCVS Group. All Rights Reserved.
#
# By using this file, you agree to the terms and conditions set forth in
# the LICENSE.html file which can be found at the top level of the ViewVC
# distribution or at http://viewvc.org/license-1.html.
#
# For more information, visit h... | 0 | 0 | 0 | 24,255 | 0 | 2,846 | 0 | 72 | 163 |
defb121c8e657f37a2d4f8f5f56bc62934ede14f | 14,143 | py | Python | pdfannots.py | pykong/pdfannots | 4d95245d95dca6d1114b39674c2bd5d329d825e7 | [
"MIT"
] | 1 | 2018-11-23T12:29:52.000Z | 2018-11-23T12:29:52.000Z | pdfannots.py | pykong/pdfannots | 4d95245d95dca6d1114b39674c2bd5d329d825e7 | [
"MIT"
] | null | null | null | pdfannots.py | pykong/pdfannots | 4d95245d95dca6d1114b39674c2bd5d329d825e7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import PyPDF2 as PyPDF2
import pdfminer.pdftypes as pdftypes
import pdfminer.settings
pdfminer.settings.STRICT = False
SUBSTITUTIONS = {
u'': 'ff',
u'': 'fi',
u'': 'fl',
u'': "'",
}
ANNOT_SUBTYPES = set(['Text', 'Highlight', 'Squiggly', 'StrikeOut', 'U... | 32.143182 | 114 | 0.581489 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import io
import pathlib
import sys
import tempfile
from multiprocessing import Pool, cpu_count
import PyPDF2 as PyPDF2
import click
import pdfminer.pdftypes as pdftypes
import pdfminer.settings
from fpdf import FPDF
from pdfminer.converter import TextConverter
from pdf... | 12 | 794 | 0 | 4,300 | 0 | 7,738 | 0 | 209 | 676 |
c015a9dfa5a763bce4bb483cef8e2db5dd41369b | 1,196 | py | Python | scripts/loss.py | Spritaro/condinst_tensorrt | 22063a75e015bba45b588cdb6ebf1ac663ff1924 | [
"MIT"
] | 3 | 2021-11-14T14:11:10.000Z | 2022-02-16T11:42:40.000Z | scripts/loss.py | datomi79/condinst_tensorrt | 22063a75e015bba45b588cdb6ebf1ac663ff1924 | [
"MIT"
] | null | null | null | scripts/loss.py | datomi79/condinst_tensorrt | 22063a75e015bba45b588cdb6ebf1ac663ff1924 | [
"MIT"
] | 1 | 2022-02-14T21:47:55.000Z | 2022-02-14T21:47:55.000Z | import torch
def heatmap_focal_loss(preds, gt_heatmap, alpha, gamma, eps=1e-3):
"""
Params:
preds: Tensor[num_classes, height, width]
gt_heatmap: Tensor[num_classes, height, width]
alpha:
gamma: how much you want to reduce penalty around the ground truth locations
eps: a... | 31.473684 | 109 | 0.612876 | import torch
def heatmap_focal_loss(preds, gt_heatmap, alpha, gamma, eps=1e-3):
"""
Params:
preds: Tensor[num_classes, height, width]
gt_heatmap: Tensor[num_classes, height, width]
alpha:
gamma: how much you want to reduce penalty around the ground truth locations
eps: a... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
cfcd628d6daa7217e23c473f633d9ebe42bea5a0 | 3,352 | py | Python | preprocessors/verilog_tokenize.py | JonathanPierce/Algae | 8fc42981f8a97a3ee9d9f71cb051621422150a08 | [
"MIT"
] | 18 | 2015-09-01T03:47:42.000Z | 2021-01-28T21:49:09.000Z | preprocessors/verilog_tokenize.py | JonathanPierce/Algae | 8fc42981f8a97a3ee9d9f71cb051621422150a08 | [
"MIT"
] | 5 | 2015-11-24T21:51:39.000Z | 2016-01-04T18:59:43.000Z | preprocessors/verilog_tokenize.py | JonathanPierce/Algae | 8fc42981f8a97a3ee9d9f71cb051621422150a08 | [
"MIT"
] | 4 | 2016-01-22T11:23:48.000Z | 2018-02-22T23:41:27.000Z | import pygments.lexers.hdl as lexers
import helpers.common as common
tokenizer = lexers.VerilogLexer()
| 37.662921 | 1,353 | 0.666766 | import pygments.lexers.hdl as lexers
from multiprocessing import Process
import helpers.common as common
tokenizer = lexers.VerilogLexer()
def compress_value(value):
names = ['always', 'always_comb', 'always_ff', 'always_latch', 'and', 'assign', 'automatic', 'begin', 'break', 'buf', 'bufif0', 'bufif1', 'case', 'casex... | 0 | 0 | 0 | 0 | 0 | 3,097 | 0 | 14 | 137 |
8674b3f9d5c0f0928f6536ab7399dbeda0ee16e1 | 20,839 | py | Python | tests/test_event_handlers.py | star302b/dj-stripe | 1d26394414515c4f3ada7132b0eae8f793a0badd | [
"MIT"
] | null | null | null | tests/test_event_handlers.py | star302b/dj-stripe | 1d26394414515c4f3ada7132b0eae8f793a0badd | [
"MIT"
] | null | null | null | tests/test_event_handlers.py | star302b/dj-stripe | 1d26394414515c4f3ada7132b0eae8f793a0badd | [
"MIT"
] | null | null | null | """
.. module:: dj-stripe.tests.test_event_handlers
:synopsis: dj-stripe Event Handler Tests.
.. moduleauthor:: Alex Kavanaugh (@kavdev)
.. moduleauthor:: Lee Skillen (@lskillen)
"""
#
# Helpers
#
| 46.619687 | 118 | 0.729018 | """
.. module:: dj-stripe.tests.test_event_handlers
:synopsis: dj-stripe Event Handler Tests.
.. moduleauthor:: Alex Kavanaugh (@kavdev)
.. moduleauthor:: Lee Skillen (@lskillen)
"""
from copy import deepcopy
import decimal
from django.contrib.auth import get_user_model
from django.test import TestCase
from mock... | 0 | 18,380 | 0 | 668 | 0 | 0 | 0 | 982 | 588 |
9ff7a9dd754ac5e203b75c39934d21c4dbb3bd05 | 4,489 | py | Python | kms_utils.py | unai-ttxu/marathon-lb-sec | a893cc7c550af02b15d307f941023c7d26a9f1ba | [
"Apache-2.0"
] | 23 | 2017-04-17T14:15:10.000Z | 2021-03-27T12:14:58.000Z | kms_utils.py | unai-ttxu/marathon-lb-sec | a893cc7c550af02b15d307f941023c7d26a9f1ba | [
"Apache-2.0"
] | 13 | 2017-11-10T11:31:04.000Z | 2019-07-02T08:13:21.000Z | kms_utils.py | unai-ttxu/marathon-lb-sec | a893cc7c550af02b15d307f941023c7d26a9f1ba | [
"Apache-2.0"
] | 17 | 2017-03-17T08:48:59.000Z | 2020-04-13T15:06:48.000Z | import os
head_vault_hosts = 'OLD_IFS=${IFS};IFS=\',\' read -r -a VAULT_HOSTS <<< \"$STRING_VAULT_HOST\";IFS=${OLD_IFS};'
source_kms_utils = '. /usr/sbin/kms_utils.sh;'
global vault_token
global vault_accessor
global MAX_PERCENTAGE_EXPIRATION
vault_token = os.getenv('VAULT_TOKEN', '')
vault_accessor = os.getenv('ACC... | 34.267176 | 183 | 0.704611 | import common
import json
import logging
import os
import subprocess
import time
from dateutil import parser
head_vault_hosts = 'OLD_IFS=${IFS};IFS=\',\' read -r -a VAULT_HOSTS <<< \"$STRING_VAULT_HOST\";IFS=${OLD_IFS};'
source_kms_utils = '. /usr/sbin/kms_utils.sh;'
global vault_token
global vault_accessor
global M... | 0 | 0 | 0 | 0 | 0 | 3,844 | 0 | -33 | 293 |
7d51bd641910bdf93e36062ca99dbd8e06962b76 | 154 | py | Python | chapter_2/intro-sys-mod.py | bimri/programming_python | ba52ccd18b9b4e6c5387bf4032f381ae816b5e77 | [
"MIT"
] | null | null | null | chapter_2/intro-sys-mod.py | bimri/programming_python | ba52ccd18b9b4e6c5387bf4032f381ae816b5e77 | [
"MIT"
] | null | null | null | chapter_2/intro-sys-mod.py | bimri/programming_python | ba52ccd18b9b4e6c5387bf4032f381ae816b5e77 | [
"MIT"
] | null | null | null | "Introducing the sys Module"
import sys
print(sys.platform)
print(sys.maxsize)
print(sys.version)
if sys.platform[:3] == 'win': print('hello windows')
| 17.111111 | 52 | 0.727273 | "Introducing the sys Module"
import sys
print(sys.platform)
print(sys.maxsize)
print(sys.version)
if sys.platform[:3] == 'win': print('hello windows')
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
842d510acc09dda24940ad15781378acbc93a47e | 1,009 | py | Python | aoc/day09.py | ryanolsonx/aocpy | 051f965c443c3d4798e15f1fe86327b0d755d27f | [
"MIT"
] | null | null | null | aoc/day09.py | ryanolsonx/aocpy | 051f965c443c3d4798e15f1fe86327b0d755d27f | [
"MIT"
] | null | null | null | aoc/day09.py | ryanolsonx/aocpy | 051f965c443c3d4798e15f1fe86327b0d755d27f | [
"MIT"
] | null | null | null | with open("./day09.input") as file:
data = [int(line.strip()) for line in file.readlines()]
p1 = get_first_not_matching(25)
print(p1)
p2 = get_contiguous_ns_that_add_to(p1)
print(p2) | 15.287879 | 56 | 0.581764 | with open("./day09.input") as file:
data = [int(line.strip()) for line in file.readlines()]
def get_first_not_matching(preamble_size):
i = preamble_size
while i < len(data):
n = data[i]
is_match = False
ds = data[i - preamble_size:i]
for j in ds:
for k in ds:
if j == k:
continue
if j + k =... | 0 | 0 | 0 | 0 | 0 | 753 | 0 | 0 | 69 |
5f957dac4e3aaa4e9760d7ae025a52ebc53a0390 | 1,533 | py | Python | utils/ppmi_data.py | Devin-Taylor/multi-head-co-attention | 466bf1cfe39bc271ff5a1947e15756b69cf22967 | [
"MIT"
] | 2 | 2019-11-04T14:26:21.000Z | 2019-11-09T21:13:41.000Z | utils/ppmi_data.py | Devin-Taylor/multi-head-co-attention | 466bf1cfe39bc271ff5a1947e15756b69cf22967 | [
"MIT"
] | null | null | null | utils/ppmi_data.py | Devin-Taylor/multi-head-co-attention | 466bf1cfe39bc271ff5a1947e15756b69cf22967 | [
"MIT"
] | null | null | null | import os
ROOT = "./"
DATA = os.path.join(ROOT, "data/")
| 38.325 | 127 | 0.714938 | import json
import os
import nibabel as nib
import numpy as np
import pandas as pd
ROOT = "./"
DATA = os.path.join(ROOT, "data/")
def load_ppmi(dataset, filter_feats=True, normalise=True):
patient_summary = pd.read_csv(os.path.join(DATA, "patient_summary.csv"))
metadata = patient_summary[patient_summary.DIAG... | 0 | 0 | 0 | 0 | 0 | 1,378 | 0 | -15 | 112 |
1a9eb26b2e45a592e8105ef8cc9bc6ff155afcb4 | 3,981 | py | Python | Programming_for_GIA_Core_Skills/Assessment_2/final_model.py | jord9762/jordy9762.github.io | 28bcc21d140371e08cd074895f48fe646e2e7c79 | [
"Apache-2.0"
] | null | null | null | Programming_for_GIA_Core_Skills/Assessment_2/final_model.py | jord9762/jordy9762.github.io | 28bcc21d140371e08cd074895f48fe646e2e7c79 | [
"Apache-2.0"
] | null | null | null | Programming_for_GIA_Core_Skills/Assessment_2/final_model.py | jord9762/jordy9762.github.io | 28bcc21d140371e08cd074895f48fe646e2e7c79 | [
"Apache-2.0"
] | null | null | null | import matplotlib
import csv
import drunkframework
import matplotlib.animation
import matplotlib.pyplot
"""WARNING!!!!!"""
"""This code was tested using Spyder 5.0.4, should any problems be encountered using older
models please try """
#creates a new empty list for what will be the csv environment da... | 36.190909 | 140 | 0.707109 | import matplotlib
import random
import operator
import csv
import drunkframework
import matplotlib.animation
import matplotlib.pyplot
"""WARNING!!!!!"""
"""This code was tested using Spyder 5.0.4, should any problems be encountered using older
models please try """
#creates a new empty list for wha... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -14 | 46 |
7fb3bf3ccd9b91d3bdbcbdf7e10aa8941cf222d8 | 1,841 | py | Python | script/test_caffemodel.py | duguyue100/transcaffe | aee7f34e98630ca4b1d717f65bc3b83edd00acd6 | [
"MIT"
] | 1 | 2017-10-30T01:34:14.000Z | 2017-10-30T01:34:14.000Z | script/test_caffemodel.py | duguyue100/transcaffe | aee7f34e98630ca4b1d717f65bc3b83edd00acd6 | [
"MIT"
] | null | null | null | script/test_caffemodel.py | duguyue100/transcaffe | aee7f34e98630ca4b1d717f65bc3b83edd00acd6 | [
"MIT"
] | 1 | 2021-07-11T04:30:58.000Z | 2021-07-11T04:30:58.000Z | """Loading a .caffemodel and figure out the encoding.
Author: Yuhuang Hu
Email : duguyue100@gmail.com
"""
from __future__ import absolute_import
from __future__ import print_function
import os
# from keras.utils.visualize_util import plot
from keras.datasets import mnist as dataset
from keras.utils import np_utils
... | 27.893939 | 70 | 0.751222 | """Loading a .caffemodel and figure out the encoding.
Author: Yuhuang Hu
Email : duguyue100@gmail.com
"""
from __future__ import absolute_import
from __future__ import print_function
import os
# from keras.utils.visualize_util import plot
from keras.datasets import mnist as dataset
from keras.utils import np_utils
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
bdafb5b9a495fe79186ed42ceb1d64616f684e58 | 2,044 | py | Python | tlaunch/lp_k8s/config.py | TARTRL/TLaunch | 198dada129f2143b6f626a50b82d45575f4c1115 | [
"Apache-2.0"
] | 18 | 2021-12-19T09:43:17.000Z | 2021-12-30T06:09:03.000Z | tlaunch/lp_k8s/config.py | TARTRL/TLaunch | 198dada129f2143b6f626a50b82d45575f4c1115 | [
"Apache-2.0"
] | null | null | null | tlaunch/lp_k8s/config.py | TARTRL/TLaunch | 198dada129f2143b6f626a50b82d45575f4c1115 | [
"Apache-2.0"
] | 1 | 2022-01-14T06:20:20.000Z | 2022-01-14T06:20:20.000Z |
DEFAULT_PORT = 8001
DEFAULT_NAME = 'launchpad'
REVERB_IMAGE = 'reg.real-ai.cn/launchpad/reverb'
DEFAULT_COMMAND = ['python3', '-u', '-mlaunchpad_kubernetes.process_entry']
| 30.969697 | 79 | 0.627202 | from typing import Dict, List, Optional
from kubernetes import client
from tlaunch.lp_k8s.resource import Resource
from tlaunch.lp_k8s.util import map_opt
DEFAULT_PORT = 8001
DEFAULT_NAME = 'launchpad'
REVERB_IMAGE = 'reg.real-ai.cn/launchpad/reverb'
DEFAULT_COMMAND = ['python3', '-u', '-mlaunchpad_kubernetes.proces... | 0 | 0 | 0 | 1,642 | 0 | 0 | 0 | 67 | 159 |
2f89d30a8c0491da0365da93766c0592009a4f5a | 2,694 | py | Python | retry_download_errors.py | calstateteach/canvas_artifacts_download | 1fbff01c80214d1e05616097aecd13cbb7faa3ca | [
"MIT"
] | null | null | null | retry_download_errors.py | calstateteach/canvas_artifacts_download | 1fbff01c80214d1e05616097aecd13cbb7faa3ca | [
"MIT"
] | null | null | null | retry_download_errors.py | calstateteach/canvas_artifacts_download | 1fbff01c80214d1e05616097aecd13cbb7faa3ca | [
"MIT"
] | null | null | null | """Retry downloading files that caused errors in http_downloader.
We can find files to try downloading again by parsing the err.txt file for error messages.
Error log lines we are interested in look like:
09-04-2017 12:45:17..Error_http_downloader 'exports/CalStateTEACH Term 1/grios/Schedule/Mentor Info.docx', 'https:... | 30.613636 | 228 | 0.639198 | """Retry downloading files that caused errors in http_downloader.
We can find files to try downloading again by parsing the err.txt file for error messages.
Error log lines we are interested in look like:
09-04-2017 12:45:17..Error_http_downloader 'exports/CalStateTEACH Term 1/grios/Schedule/Mentor Info.docx', 'https:... | 0 | 0 | 0 | 0 | 0 | 1,131 | 0 | -19 | 134 |
fea9894192b3f338d5d4d6a5b7224a49e2e10fb5 | 4,769 | py | Python | beatcrunch/utils/model_common.py | iero/BeatCrunch | baa88595670b0dc1fb2a0e95fe33b176a0c010d6 | [
"Apache-2.0"
] | null | null | null | beatcrunch/utils/model_common.py | iero/BeatCrunch | baa88595670b0dc1fb2a0e95fe33b176a0c010d6 | [
"Apache-2.0"
] | null | null | null | beatcrunch/utils/model_common.py | iero/BeatCrunch | baa88595670b0dc1fb2a0e95fe33b176a0c010d6 | [
"Apache-2.0"
] | null | null | null |
# Common stopwords in french and english
# Clean text or sentence, removing stopwords
# return list
| 108.386364 | 2,076 | 0.626756 | from nltk import RegexpTokenizer
# Common stopwords in french and english
def get_stopwords(lang) :
stopset = []
stopwords_ponctuation = [',','"',';',':','.','?','!','*','—']
for w in stopwords_ponctuation: stopset.append(w)
if lang == "fr" or lang == "all":
stopwords_base = ['aussi','au','aux','avec','ça','ce... | 86 | 0 | 0 | 0 | 0 | 4,552 | 0 | 11 | 66 |
b87d6c5cb06be96998619a9cb340e11359c13595 | 15,498 | py | Python | faster_rcnn/rpn_util.py | Kelicious/faster_rcnn | fde1a2f342855b8a3b6c1a54878e59d29102a26d | [
"MIT"
] | 18 | 2018-05-13T14:50:03.000Z | 2022-02-23T14:27:17.000Z | faster_rcnn/rpn_util.py | Kelicious/faster_rcnn | fde1a2f342855b8a3b6c1a54878e59d29102a26d | [
"MIT"
] | 3 | 2018-05-15T08:46:10.000Z | 2020-03-17T12:46:31.000Z | faster_rcnn/rpn_util.py | Kelicious/faster_rcnn | fde1a2f342855b8a3b6c1a54878e59d29102a26d | [
"MIT"
] | 15 | 2018-05-13T14:50:24.000Z | 2022-02-24T09:50:07.000Z |
POS_OVERLAP = 0.7
NEG_OVERLAP = 0.3
SAMPLE_SIZE = 256
MAX_POS_SAMPLES = 128
def _idx_to_conv(idx, conv_width, anchors_per_loc):
"""
Converts an anchor box index in a 1-d numpy array to its corresponding 3-d index representing its convolution
position and anchor index.
:param idx: non-negative inte... | 44.153846 | 154 | 0.703123 | import random
from enum import Enum
import numpy as np
from custom_decorators import profile
from shapes import Box
from shared_constants import BBREG_MULTIPLIERS, DEFAULT_ANCHORS
from util import calc_iou, cross_ious, get_reg_params, get_bbox_coords
POS_OVERLAP = 0.7
NEG_OVERLAP = 0.3
SAMPLE_SIZE = 256
MAX_POS_SAM... | 0 | 11,747 | 0 | 1,173 | 0 | 399 | 0 | 97 | 432 |