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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2bdfea61bdffd87d5a288a584fb1f4ba06e258ec | 10,705 | py | Python | py/datacentric/storage/mongo/temporal_mongo_query.py | datacentricorg/datacentric-py | 40113ddfb68e62d98b880b3c7427db5cc9fbd8cd | [
"Apache-2.0"
] | 1 | 2020-02-03T18:32:42.000Z | 2020-02-03T18:32:42.000Z | py/datacentric/storage/mongo/temporal_mongo_query.py | datacentricorg/datacentric-py | 40113ddfb68e62d98b880b3c7427db5cc9fbd8cd | [
"Apache-2.0"
] | null | null | null | py/datacentric/storage/mongo/temporal_mongo_query.py | datacentricorg/datacentric-py | 40113ddfb68e62d98b880b3c7427db5cc9fbd8cd | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2013-present The DataCentric Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 44.053498 | 118 | 0.61149 | # Copyright (C) 2013-present The DataCentric Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 0 | 2,057 | 0 | 7,200 | 0 | 0 | 0 | 369 | 292 |
6daea32653f8bd677262df36032b5d33bb969a65 | 273 | py | Python | Ex024.py | Fernando-Rodrigo/Exercicios | 04fe641220f36df85a754b2944d60f245cf6cabd | [
"MIT"
] | 1 | 2022-03-14T20:49:04.000Z | 2022-03-14T20:49:04.000Z | Ex024.py | Fernando-Rodrigo/Exercicios | 04fe641220f36df85a754b2944d60f245cf6cabd | [
"MIT"
] | null | null | null | Ex024.py | Fernando-Rodrigo/Exercicios | 04fe641220f36df85a754b2944d60f245cf6cabd | [
"MIT"
] | null | null | null | # coding=utf-8
nome = str(input('Digite o nome da cidade onde mora para saber se tem Santo no nome ')).strip()
u = nome.upper()
n = u.find('SANTO')
if n == 0:
print('O nome da cidade tem Santo no incio.')
else:
print('O nome da cidade no tem Santo no incio.')
| 24.818182 | 95 | 0.655678 | # coding=utf-8
nome = str(input('Digite o nome da cidade onde mora para saber se tem Santo no nome ')).strip()
u = nome.upper()
n = u.find('SANTO')
if n == 0:
print('O nome da cidade tem Santo no início.')
else:
print('O nome da cidade não tem Santo no início.')
| 6 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
356632435cb248d71f8d00c00961603f3cf140e3 | 3,233 | py | Python | muk_utils/models/res_config_settings.py | alexhong121/odoo_model | 4eff41c672bd03084eaa6eae81c8f3d359c2fb8d | [
"MIT"
] | null | null | null | muk_utils/models/res_config_settings.py | alexhong121/odoo_model | 4eff41c672bd03084eaa6eae81c8f3d359c2fb8d | [
"MIT"
] | null | null | null | muk_utils/models/res_config_settings.py | alexhong121/odoo_model | 4eff41c672bd03084eaa6eae81c8f3d359c2fb8d | [
"MIT"
] | 1 | 2021-05-05T07:59:08.000Z | 2021-05-05T07:59:08.000Z | ###################################################################################
#
# Copyright (c) 2017-2019 MuK IT GmbH.
#
# This file is part of MuK Utils
# (see https://mukit.at).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Genera... | 38.951807 | 90 | 0.539746 | ###################################################################################
#
# Copyright (c) 2017-2019 MuK IT GmbH.
#
# This file is part of MuK Utils
# (see https://mukit.at).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Genera... | 0 | 769 | 0 | 1,435 | 0 | 0 | 0 | 15 | 46 |
fe4e745b4502ca6e5f3678c79b9f51923237c340 | 740 | py | Python | app/__init__.py | Jwilson1172/DS-Unit-3-Sprint-3-Productization-and-Cloud | c09c8942fe9263e6da15665a781e677dd336734b | [
"MIT"
] | null | null | null | app/__init__.py | Jwilson1172/DS-Unit-3-Sprint-3-Productization-and-Cloud | c09c8942fe9263e6da15665a781e677dd336734b | [
"MIT"
] | null | null | null | app/__init__.py | Jwilson1172/DS-Unit-3-Sprint-3-Productization-and-Cloud | c09c8942fe9263e6da15665a781e677dd336734b | [
"MIT"
] | null | null | null | # web_app/__init__.py
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from app.routes.home_routes import home_routes
from app.routes.book_routes import book_routes
db = SQLAlchemy()
migrate = Migrate()
# app factory structure
db = SQLAlchemy()
migrate = Migrate()
... | 21.764706 | 70 | 0.72973 | # web_app/__init__.py
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from app.routes.home_routes import home_routes
from app.routes.book_routes import book_routes
db = SQLAlchemy()
migrate = Migrate()
# app factory structure
def create_app():
app = Flask(__nam... | 0 | 0 | 0 | 0 | 0 | 154 | 0 | 0 | 22 |
1c12ba2c7a47631dcf8b150f1599de4937fbd817 | 18,928 | py | Python | trilearn/graph/junction_tree.py | melmasri/trilearn | cbda999140881a5f0e01d75a54d5ff55201a33e7 | [
"Apache-2.0"
] | null | null | null | trilearn/graph/junction_tree.py | melmasri/trilearn | cbda999140881a5f0e01d75a54d5ff55201a33e7 | [
"Apache-2.0"
] | null | null | null | trilearn/graph/junction_tree.py | melmasri/trilearn | cbda999140881a5f0e01d75a54d5ff55201a33e7 | [
"Apache-2.0"
] | null | null | null | """
Functions related to junction trees.
"""
import networkx as nx
import numpy as np
import trilearn.graph.junction_tree_expander as jte
def is_junction_tree(tree):
""" Checks the junction tree property of tree.
Args:
tree (NetworkX graph): A junction tree.
Returns:
bool: True if tre... | 28.722307 | 153 | 0.564877 | """
Functions related to junction trees.
"""
import networkx as nx
import numpy as np
import trilearn.graph.junction_tree_expander as jte
class JunctionTree(nx.Graph):
def __init__(self, data=None, **attr):
nx.Graph.__init__(self, data, **attr)
self.log_nus = {}
self.separators = None
... | 0 | 0 | 0 | 3,591 | 0 | 1,617 | 0 | 21 | 141 |
8eeeb760ec1c14eb749f848c89f24dced0a84ea4 | 10,744 | py | Python | lib.py | fuyuanli/FuYuanDNS | e9fdd4b495792777f2d9cc17ba2a196d238ba247 | [
"MIT"
] | 1 | 2019-03-26T19:01:20.000Z | 2019-03-26T19:01:20.000Z | lib.py | fuyuanli/FuYuanDNS | e9fdd4b495792777f2d9cc17ba2a196d238ba247 | [
"MIT"
] | null | null | null | lib.py | fuyuanli/FuYuanDNS | e9fdd4b495792777f2d9cc17ba2a196d238ba247 | [
"MIT"
] | 1 | 2019-03-26T19:01:23.000Z | 2019-03-26T19:01:23.000Z | #!/usr/bin/python3
# -*- coding: UTF-8 -*-
| 43.148594 | 93 | 0.486318 | #!/usr/bin/python3
# -*- coding: UTF-8 -*-
import ipaddress
class DNSPacket:
def __init__(self, data):
self.data = data
self.dnsType = int(str("0x"+str(self.data[-3:-2])[4:6]), 16)
self.dnsClass = int(str("0x"+str(self.data[-1:])[4:6]), 16)
self.domainName = self.getDomianName()
... | 0 | 0 | 0 | 10,661 | 0 | 0 | 0 | -5 | 45 |
622b77c1210d6f687fdecb00a8f611c5cb5da916 | 2,035 | py | Python | server/routers/internal/santander_cycles.py | mitchLui/css_boeing_hackathon_2-22 | ded74fb3ea0cd1fbfa7539f091e6f3d4b8663234 | [
"MIT"
] | 1 | 2022-03-10T12:46:11.000Z | 2022-03-10T12:46:11.000Z | server/routers/internal/santander_cycles.py | mitchLui/css_boeing_hackathon_2-22 | ded74fb3ea0cd1fbfa7539f091e6f3d4b8663234 | [
"MIT"
] | 2 | 2022-03-02T12:11:24.000Z | 2022-03-02T12:11:31.000Z | server/routers/internal/santander_cycles.py | mitchLui/css_boeing_hackathon_2-22 | ded74fb3ea0cd1fbfa7539f091e6f3d4b8663234 | [
"MIT"
] | null | null | null |
SANTANDER_URL = "https://tfl.gov.uk/tfl/syndication/feeds/cycle-hire/livecyclehireupdates.xml"
COST_PER_HALF_AN_HOUR = "2.00"
if __name__ == "__main__":
cycle_service = SantanderCycles()
print(cycle_service.get_cycles(51.5007, -0.1246, 1000))
| 35.086207 | 94 | 0.619656 | import requests
import xmltodict # convert xml to json
import json
import haversine as hs # used for distance calculations between coordinates
from typing import List
SANTANDER_URL = "https://tfl.gov.uk/tfl/syndication/feeds/cycle-hire/livecyclehireupdates.xml"
COST_PER_HALF_AN_HOUR = "2.00"
class SantanderCycles... | 0 | 0 | 0 | 1,587 | 0 | 0 | 0 | -18 | 211 |
bc8b53cc2ba3d94cb5666e99be507f08b45f60e5 | 7,264 | py | Python | pywicta/denoising/rejection_criteria.py | jeremiedecock/pywi-cta | 1185f7dfa48d60116472c12ffc423be78a250fc9 | [
"MIT"
] | null | null | null | pywicta/denoising/rejection_criteria.py | jeremiedecock/pywi-cta | 1185f7dfa48d60116472c12ffc423be78a250fc9 | [
"MIT"
] | 1 | 2018-03-23T15:44:10.000Z | 2018-03-23T15:44:10.000Z | pywicta/denoising/rejection_criteria.py | jeremiedecock/pywi-cta | 1185f7dfa48d60116472c12ffc423be78a250fc9 | [
"MIT"
] | 1 | 2018-10-02T08:34:53.000Z | 2018-10-02T08:34:53.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2017 Jrmie DECOCK (http://www.jdhp.org)
# This script is provided under the terms and conditions of the MIT license:
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ... | 39.693989 | 145 | 0.619493 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2017 Jérémie DECOCK (http://www.jdhp.org)
# This script is provided under the terms and conditions of the MIT license:
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (th... | 4 | 0 | 0 | 5,807 | 0 | 0 | 0 | 51 | 114 |
94630ffd836801a53195314e1140b8277bcda371 | 1,713 | py | Python | migrations/versions/0161_email_branding.py | cds-snc/notifier-api | 90b385ec49efbaee7e607516fc7d9f08991af813 | [
"MIT"
] | 41 | 2019-11-28T16:58:41.000Z | 2022-01-28T21:11:16.000Z | migrations/versions/0161_email_branding.py | cds-snc/notification-api | b1c1064f291eb860b494c3fa65ac256ad70bf47c | [
"MIT"
] | 1,083 | 2019-07-08T12:57:24.000Z | 2022-03-08T18:53:40.000Z | migrations/versions/0161_email_branding.py | cds-snc/notifier-api | 90b385ec49efbaee7e607516fc7d9f08991af813 | [
"MIT"
] | 9 | 2020-01-24T19:56:43.000Z | 2022-01-27T21:36:53.000Z | """
Revision ID: 0161_email_branding
Revises: 0160_another_letter_org
Create Date: 2018-01-30 15:35:12.016574
"""
revision = "0161_email_branding"
down_revision = "0160_another_letter_org"
| 29.033898 | 93 | 0.647402 | """
Revision ID: 0161_email_branding
Revises: 0160_another_letter_org
Create Date: 2018-01-30 15:35:12.016574
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql
revision = "0161_email_branding"
down_revision = "0160_another_letter_org"
def upgrade():
op.create_table(
... | 0 | 0 | 0 | 0 | 0 | 1,383 | 0 | 24 | 112 |
35b437405d59f5b58843b2361dbb0e1a0e00d7ee | 3,741 | py | Python | pipeline.py | kayersIPM/python-cdk-template | e114457ccd12fbdbd436f19eb23ff05a455e3b57 | [
"MIT-0"
] | 59 | 2021-08-09T16:57:38.000Z | 2022-03-29T11:26:35.000Z | pipeline.py | kayersIPM/python-cdk-template | e114457ccd12fbdbd436f19eb23ff05a455e3b57 | [
"MIT-0"
] | null | null | null | pipeline.py | kayersIPM/python-cdk-template | e114457ccd12fbdbd436f19eb23ff05a455e3b57 | [
"MIT-0"
] | 11 | 2021-11-13T23:00:58.000Z | 2022-03-30T04:49:51.000Z | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# 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, c... | 41.566667 | 91 | 0.682972 | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# 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, c... | 0 | 368 | 0 | 2,173 | 0 | 0 | 0 | 45 | 202 |
91537e13eea1a2fb0371c822106fed46f8070f6d | 28,987 | py | Python | evaluation.py | RichardHGL/knowledge_representation_pytorch | 2bdbc255c4a3b63c2eef276dba696537c0da4c30 | [
"MIT"
] | 327 | 2018-03-26T14:00:04.000Z | 2022-03-27T07:48:50.000Z | evaluation.py | moonlightlong/knowledge_representation_pytorch | 26446f26ac16d57927da29c123718f244085dec4 | [
"MIT"
] | 15 | 2018-03-26T15:16:15.000Z | 2021-06-11T05:28:21.000Z | evaluation.py | moonlightlong/knowledge_representation_pytorch | 26446f26ac16d57927da29c123718f244085dec4 | [
"MIT"
] | 99 | 2018-03-27T05:03:42.000Z | 2021-11-30T06:17:13.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date : 2017-12-15 16:03:42
# @Author : jimmy (jimmywangheng@qq.com)
# @Link : http://sdcs.sysu.edu.cn
# @Version : $Id$
import torch
import torch.autograd as autograd
import torch.nn as nn
import torch.optim as optim
USE_CUDA = torch.cuda.is_available()
if USE_... | 33.433679 | 116 | 0.723945 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date : 2017-12-15 16:03:42
# @Author : jimmy (jimmywangheng@qq.com)
# @Link : http://sdcs.sysu.edu.cn
# @Version : $Id$
import os
import numpy as np
import time
import datetime
import random
import multiprocessing
import math
from itertools import groupby
from ... | 0 | 0 | 0 | 5,009 | 0 | 22,538 | 0 | 18 | 659 |
7f8600f205551b7b6cf9613d7df13b0fd531f43f | 487 | py | Python | bitcoinkeyaddr.py | lugaxker/bitcoinkeyaddr | 457f5c8f171fba6301816eaccf0b799040ee4bb0 | [
"MIT"
] | null | null | null | bitcoinkeyaddr.py | lugaxker/bitcoinkeyaddr | 457f5c8f171fba6301816eaccf0b799040ee4bb0 | [
"MIT"
] | null | null | null | bitcoinkeyaddr.py | lugaxker/bitcoinkeyaddr | 457f5c8f171fba6301816eaccf0b799040ee4bb0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
if sys.version_info < (3, 5):
sys.exit("Error: Must be using Python 3.5 or higher")
import imp
imp.load_module('bitcoinkeyaddr', *imp.find_module('lib'))
imp.load_module('bitcoinkeyaddr_gui', *imp.find_module('gui'))
from PyQt5.QtWidgets import QApplicati... | 25.631579 | 62 | 0.714579 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
if sys.version_info < (3, 5):
sys.exit("Error: Must be using Python 3.5 or higher")
import imp
imp.load_module('bitcoinkeyaddr', *imp.find_module('lib'))
imp.load_module('bitcoinkeyaddr_gui', *imp.find_module('gui'))
from PyQt5.QtWidgets import QApplicati... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 22 | 22 |
18ee572762624f93ac53b3241f3e7bee31e6f61b | 16,889 | py | Python | Visualize/utils.py | oldpaws/AI3601_RL_Final_Project_MAGAIL | 6e53d5c4ad21c9e3907e6d14b20c04b3287800cf | [
"MIT"
] | null | null | null | Visualize/utils.py | oldpaws/AI3601_RL_Final_Project_MAGAIL | 6e53d5c4ad21c9e3907e6d14b20c04b3287800cf | [
"MIT"
] | null | null | null | Visualize/utils.py | oldpaws/AI3601_RL_Final_Project_MAGAIL | 6e53d5c4ad21c9e3907e6d14b20c04b3287800cf | [
"MIT"
] | null | null | null | """
This file implements the calculation of available features independently. For usage, you should call
`subscribe_features` firstly, then retrive the corresponding observation adapter by define observation space
observation_space = gym.spaces.Dict(subscribe_features(`
dict(
distance_to_center=(stack_size... | 40.501199 | 112 | 0.593937 | """
This file implements the calculation of available features independently. For usage, you should call
`subscribe_features` firstly, then retrive the corresponding observation adapter by define observation space
observation_space = gym.spaces.Dict(subscribe_features(`
dict(
distance_to_center=(stack_size... | 60 | 11,504 | 0 | -8 | 0 | 2,008 | 0 | 82 | 536 |
ff1d7997c0c885b781804fc22b72cd916481a8da | 2,808 | py | Python | treelearn/treelearn/__init__.py | DouglasOrr/Snippets | 026e15a422b518ee7d9ce4849f971c4403ad9fe8 | [
"MIT"
] | null | null | null | treelearn/treelearn/__init__.py | DouglasOrr/Snippets | 026e15a422b518ee7d9ce4849f971c4403ad9fe8 | [
"MIT"
] | 1 | 2020-04-11T18:07:19.000Z | 2020-04-11T18:07:19.000Z | treelearn/treelearn/__init__.py | DouglasOrr/Snippets | 026e15a422b518ee7d9ce4849f971c4403ad9fe8 | [
"MIT"
] | null | null | null | import collections
### HyperOptimization Parameters ###
Scalar = collections.namedtuple("Scalar", ("scale", "default", "min", "max"))
Either = collections.namedtuple("Either", ("alternatives",))
### Execution ###
Command = collections.namedtuple("Command", ("shell", "chdir", "options"))
def command(shell, chdir = ... | 35.544304 | 91 | 0.652778 | import collections
### HyperOptimization Parameters ###
Scalar = collections.namedtuple("Scalar", ("scale", "default", "min", "max"))
Either = collections.namedtuple("Either", ("alternatives",))
def linear(default, min = None, max = None):
return Scalar("linear", default, min, max)
def logarithmic(default, min ... | 0 | 0 | 0 | 0 | 0 | 177 | 0 | 0 | 69 |
01b032947b95d719979139b1ca49727c44c3f5cb | 3,010 | py | Python | tests/test_performance/test_reversed.py | Theodikes/listchaining | 3d63aea066a2a7c0c68e9c260eefc67ef67889e2 | [
"MIT"
] | 3 | 2021-07-22T13:34:53.000Z | 2021-07-27T12:28:04.000Z | tests/test_performance/test_reversed.py | Theodikes/listchaining | 3d63aea066a2a7c0c68e9c260eefc67ef67889e2 | [
"MIT"
] | null | null | null | tests/test_performance/test_reversed.py | Theodikes/listchaining | 3d63aea066a2a7c0c68e9c260eefc67ef67889e2 | [
"MIT"
] | null | null | null | from random import randint
random_array = [randint(53454, 6565656) for _ in range(randint(1000000, 2000000))]
| 39.605263 | 120 | 0.78505 | import listchaining
from random import randint
from time import time
from typing import Union
from .utils import check_result_of_multiple_runs, get_percentage_difference
random_array = [randint(53454, 6565656) for _ in range(randint(1000000, 2000000))]
def get_reversed_method_execution_time(array: list) -> Union[in... | 0 | 2,456 | 0 | 0 | 0 | 179 | 0 | 55 | 203 |
c65991ab6b28df522a4166fe9e33e47799614c92 | 3,390 | py | Python | active_mail_filter/simple_db.py | kfrodgers/active-mail-filter | cd453e6a995659c1aea796695ea52c11420fc0f7 | [
"BSD-2-Clause"
] | null | null | null | active_mail_filter/simple_db.py | kfrodgers/active-mail-filter | cd453e6a995659c1aea796695ea52c11420fc0f7 | [
"BSD-2-Clause"
] | null | null | null | active_mail_filter/simple_db.py | kfrodgers/active-mail-filter | cd453e6a995659c1aea796695ea52c11420fc0f7 | [
"BSD-2-Clause"
] | null | null | null | # Copyright (c) 2016, Kevin Rodgers
# Released subject to the New BSD License
# Please see http://en.wikipedia.org/wiki/BSD_licenses
UUID = 'uuid'
| 26.904762 | 112 | 0.575221 | # Copyright (c) 2016, Kevin Rodgers
# Released subject to the New BSD License
# Please see http://en.wikipedia.org/wiki/BSD_licenses
import redis
from uuid import uuid4
UUID = 'uuid'
class SimpleRedisDb(object):
def __init__(self, host, key, port=6379):
"""
:param host: database host
:p... | 0 | 0 | 0 | 3,181 | 0 | 0 | 0 | -8 | 68 |
de061e0c32ee55dc79321bdaf74a5efb8664aeb8 | 937 | py | Python | _scripts/checkdb_eq.py | Erotemic/hotspotter | 3cfa4015798e21385455b937f9083405c4b3cf53 | [
"Apache-2.0"
] | 2 | 2015-07-19T02:55:06.000Z | 2021-07-07T02:38:26.000Z | _scripts/checkdb_eq.py | Erotemic/hotspotter | 3cfa4015798e21385455b937f9083405c4b3cf53 | [
"Apache-2.0"
] | 5 | 2017-03-11T16:30:26.000Z | 2021-04-10T16:42:10.000Z | _scripts/checkdb_eq.py | Erotemic/hotspotter | 3cfa4015798e21385455b937f9083405c4b3cf53 | [
"Apache-2.0"
] | 10 | 2015-07-19T03:05:42.000Z | 2021-08-24T14:48:59.000Z | from __future__ import print_function, division
from os.path import join
# on baker street
local_work = "D:/data/work"
remote_work = "Z:/data/work"
standard_dbs = ['GZ_ALL', 'HSDB_zebra_with_mothers']
for dbname in standard_dbs:
chip_rpath = join(dbname, '_hsdb', 'chip_table.csv')
name_rpath = join(dbname, ... | 26.027778 | 58 | 0.676628 | from __future__ import print_function, division
from os.path import join, normpath, exists, dirname
# on baker street
local_work = "D:/data/work"
remote_work = "Z:/data/work"
def checktext(rpath):
fpath1 = normpath(join(local_work, rpath))
fpath2 = normpath(join(remote_work, rpath))
text1 = open(fpath1,... | 0 | 0 | 0 | 0 | 0 | 381 | 0 | 27 | 23 |
2e38132a2a8e3f0b2241467ab65649fb565714a6 | 5,425 | py | Python | bot/utilities.py | sivaksiv/bot-new | e2c6b70f9e8e70a14159d2f9aabc22f03de67fc5 | [
"MIT"
] | null | null | null | bot/utilities.py | sivaksiv/bot-new | e2c6b70f9e8e70a14159d2f9aabc22f03de67fc5 | [
"MIT"
] | null | null | null | bot/utilities.py | sivaksiv/bot-new | e2c6b70f9e8e70a14159d2f9aabc22f03de67fc5 | [
"MIT"
] | null | null | null | #! /usr/bin/python
"""
utilities.py file contains supporting functions for bot.py
"""
import os
from ciscosparkapi import CiscoSparkAPI
spark_token = os.environ.get("SPARK_BOT_TOKEN")
spark = CiscoSparkAPI(access_token=spark_token)
#
# Supporting functions
#
# Return contents following a given command
# Check if... | 27.261307 | 108 | 0.686452 | #! /usr/bin/python
"""
utilities.py file contains supporting functions for bot.py
"""
import re
import requests
import os
from ciscosparkapi import CiscoSparkAPI
from case import CaseDetail
spark_token = os.environ.get("SPARK_BOT_TOKEN")
spark = CiscoSparkAPI(access_token=spark_token)
#
# Supporting functions
#
#... | 0 | 0 | 0 | 0 | 0 | 4,088 | 0 | -12 | 419 |
68a9ae13d251f5e5f6174813086eccde33d8f2e0 | 2,187 | py | Python | marverDashboard.py | Diomede81/Events_Reporting_Dashboard | 03a74ceaf77889a60d2fe6eeee2803819527d731 | [
"MIT"
] | null | null | null | marverDashboard.py | Diomede81/Events_Reporting_Dashboard | 03a74ceaf77889a60d2fe6eeee2803819527d731 | [
"MIT"
] | null | null | null | marverDashboard.py | Diomede81/Events_Reporting_Dashboard | 03a74ceaf77889a60d2fe6eeee2803819527d731 | [
"MIT"
] | 1 | 2017-12-15T22:31:40.000Z | 2017-12-15T22:31:40.000Z | import os
import MySQLdb
from flask import Flask
app = Flask(__name__)
db = MySQLdb.connect(host=os.getenv('MYSQL_HOST',DATABASE_HOST),
user=os.getenv('MYSQL_USER', DATABASE_USERNAME),
passwd=os.getenv('MYSQL_PASSWORD',DATABASE_PASSWORD),
db=os.getenv('... | 32.161765 | 139 | 0.666209 | import json
import os
from datetime import datetime, date, timedelta
import MySQLdb
from flask import Flask
from flask import render_template,request
from settings.config import *
class DateTimeEncoder(json.JSONEncoder):
def default(self, o):
if isinstance(o, datetime):
return o.isoformat()
... | 0 | 1,262 | 0 | 302 | 0 | 0 | 0 | 43 | 180 |
1c07feb5b78810d762dbaad72c92b976456e48b5 | 1,428 | py | Python | var/spack/repos/builtin/packages/r-affycompatible/package.py | robertsawko/spack | 135cf4835f5b646c4aaa0e2eb5552c80fc3a5ce8 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2019-11-28T10:14:14.000Z | 2019-11-28T10:14:14.000Z | var/spack/repos/builtin/packages/r-affycompatible/package.py | robertsawko/spack | 135cf4835f5b646c4aaa0e2eb5552c80fc3a5ce8 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/r-affycompatible/package.py | robertsawko/spack | 135cf4835f5b646c4aaa0e2eb5552c80fc3a5ce8 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2017-01-21T17:19:32.000Z | 2017-01-21T17:19:32.000Z | # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
| 44.625 | 78 | 0.726891 | # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RAffycompatible(RPackage):
"""Affymetrix GeneChip software compatibility.
This pac... | 0 | 0 | 0 | 1,186 | 0 | 0 | 0 | -2 | 46 |
aa85d9b10c57a753c3c4175a63a6a82799f44ebd | 3,874 | py | Python | nz_crawl_demo/day3/bs4/demo3.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | nz_crawl_demo/day3/bs4/demo3.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 27 | 2020-02-12T07:55:58.000Z | 2022-03-12T00:19:09.000Z | nz_crawl_demo/day3/bs4/demo3.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 2 | 2020-02-18T01:54:55.000Z | 2020-02-21T11:36:28.000Z | from bs4 import BeautifulSoup
html = """
<table class="tablelist" cellpadding="0" cellspacing="0">
<tbody>
<tr class="h">
<td class="l" width="374"></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="even">
<... | 32.283333 | 189 | 0.513165 | from bs4 import BeautifulSoup
html = """
<table class="tablelist" cellpadding="0" cellspacing="0">
<tbody>
<tr class="h">
<td class="l" width="374">职位名称</td>
<td>职位类别</td>
<td>人数</td>
<td>地点</td>
<td>发布时间</td>
</tr>
<tr class="even... | 669 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
30f69ad47e5f44bfcf76b618fb7dc3a7778978b0 | 1,140 | py | Python | arrays/2d_ds.py | franloza/hackerrank | e66f5f5c4c1c7c0fe93146d29140692cd71625b7 | [
"MIT"
] | null | null | null | arrays/2d_ds.py | franloza/hackerrank | e66f5f5c4c1c7c0fe93146d29140692cd71625b7 | [
"MIT"
] | null | null | null | arrays/2d_ds.py | franloza/hackerrank | e66f5f5c4c1c7c0fe93146d29140692cd71625b7 | [
"MIT"
] | null | null | null | #!/bin/python3
# Complete the hourglassSum function below.
# Read from input
# if __name__ == '__main__':
# fptr = open(os.environ['OUTPUT_PATH'], 'w')
#
# arr = []
#
# for _ in range(6):
# arr.append(list(map(int, input().rstrip().split())))
#
# result = hourglassSum(arr)
#
# fptr.write(s... | 23.265306 | 92 | 0.469298 | #!/bin/python3
import math
import os
import random
import re
import sys
# Complete the hourglassSum function below.
def hourglassSum(arr):
hourglass_sums = []
for i in range(len(arr)-2):
for j in range(len(arr[i])-2):
hourglass_sums.append(sum(arr[i][j:j+3]) + arr[i+1][j+1] + sum(arr[i+2][... | 0 | 0 | 0 | 0 | 0 | 220 | 0 | -53 | 133 |
146ccc7629853048229494b92ded9f6d03e1b709 | 7,940 | py | Python | src/vtra/preprocess/convert_hazard_data.py | oi-analytics/oia-transport-archive | f89cb686704fe76c1665697b35d14caccf37f3a1 | [
"PostgreSQL"
] | 1 | 2021-03-31T02:59:50.000Z | 2021-03-31T02:59:50.000Z | src/vtra/preprocess/convert_hazard_data.py | oi-analytics/oia-transport-archive | f89cb686704fe76c1665697b35d14caccf37f3a1 | [
"PostgreSQL"
] | null | null | null | src/vtra/preprocess/convert_hazard_data.py | oi-analytics/oia-transport-archive | f89cb686704fe76c1665697b35d14caccf37f3a1 | [
"PostgreSQL"
] | 1 | 2022-02-24T16:51:47.000Z | 2022-02-24T16:51:47.000Z | # -*- coding: utf-8 -*-
"""
Created on Tue July 17 10:20:55 2018
@authors: Raghav Pant, Tom Russell, elcok
"""
import subprocess
import fiona
def convert_geotiff_to_vector_with_threshold(from_threshold,to_threshold, infile, infile_epsg,tmpfile_1, tmpfile_2, outfile):
"""Threshold raster, convert to polygons, as... | 28.768116 | 125 | 0.648363 | # -*- coding: utf-8 -*-
"""
Created on Tue July 17 10:20:55 2018
@authors: Raghav Pant, Tom Russell, elcok
"""
import os
import subprocess
import json
import sys
from vtra.utils import load_config
import fiona
import fiona.crs
import rasterio
import numpy as np
import pandas as pd
def glofris_data_details(file_na... | 0 | 0 | 0 | 0 | 0 | 4,862 | 0 | -36 | 270 |
52d8c34adfb0d62eff8742e01f23528bb9164724 | 415 | py | Python | setup.py | LMML-Team/rnn-music | 3e0627cd695b135f80b718c2b65cc879e8164b6f | [
"MIT"
] | null | null | null | setup.py | LMML-Team/rnn-music | 3e0627cd695b135f80b718c2b65cc879e8164b6f | [
"MIT"
] | null | null | null | setup.py | LMML-Team/rnn-music | 3e0627cd695b135f80b718c2b65cc879e8164b6f | [
"MIT"
] | null | null | null | from distutils.core import setup
from setuptools import find_packages
try:
except ImportError:
print("Warning: `mido` must be installed in order to use `rnn_music`")
setup(name='rnn_music',
version='1.0',
description='Generates music',
author='Petar Griggs (@Anonymission)',
author_email="m... | 24.411765 | 74 | 0.679518 | from distutils.core import setup
from setuptools import find_packages
try:
import mido
except ImportError:
print("Warning: `mido` must be installed in order to use `rnn_music`")
setup(name='rnn_music',
version='1.0',
description='Generates music',
author='Petar Griggs (@Anonymission)',
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -10 | 26 |
55b1e827227e9cc2579910010d9b1349576b9bd2 | 18,422 | py | Python | src/networks.py | fugashy/deep_learning_from_scratch | c5e9227cbf1a770101adb2a9f0f7e6c69acf497d | [
"MIT"
] | null | null | null | src/networks.py | fugashy/deep_learning_from_scratch | c5e9227cbf1a770101adb2a9f0f7e6c69acf497d | [
"MIT"
] | null | null | null | src/networks.py | fugashy/deep_learning_from_scratch | c5e9227cbf1a770101adb2a9f0f7e6c69acf497d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import sys, os
sys.path.append(os.pardir)
| 31.92721 | 91 | 0.542178 | # -*- coding: utf-8 -*-
import sys, os
from collections import OrderedDict
sys.path.append(os.pardir)
import numpy as np
import pickle
from src import (
activations, differentiations, losses, layers
)
def create(config_dict):
network_type = config_dict['type']
if network_type == 'multi_layer_network':
... | 2,886 | 0 | 0 | 14,898 | 0 | 2,190 | 0 | 51 | 249 |
0ecead66b693db7b9b91cf9a2e31d643d1853b7f | 1,059 | py | Python | Assorted_Snippets/python/socket_prototyping/server_makefile.py | KyleKing/My-Programming-Sketchbook | 3d69b0b2cb3bef4ff3ff83154b2c2560079bcb01 | [
"MIT"
] | 7 | 2016-05-27T15:54:57.000Z | 2021-05-07T03:02:21.000Z | Assorted_Snippets/python/socket_prototyping/server_makefile.py | KyleKing/My-Programming-Sketchbook | 3d69b0b2cb3bef4ff3ff83154b2c2560079bcb01 | [
"MIT"
] | 10 | 2015-07-11T03:39:56.000Z | 2021-04-10T01:03:29.000Z | Assorted_Snippets/python/socket_prototyping/server_makefile.py | KyleKing/My-Programming-Sketchbook | 3d69b0b2cb3bef4ff3ff83154b2c2560079bcb01 | [
"MIT"
] | null | null | null | """Based on https://stackoverflow.com/q/59978887/3219667.
Update: not working. May want to revisit
"""
HOST = '127.0.0.1'
PORT = 65439
ACK_TEXT = 'text_received'
if __name__ == '__main__':
main()
| 24.068182 | 79 | 0.566572 | """Based on https://stackoverflow.com/q/59978887/3219667.
Update: not working. May want to revisit
"""
import socket
from loguru import logger
HOST = '127.0.0.1'
PORT = 65439
ACK_TEXT = 'text_received'
def main():
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock:
sock.setsockopt(socket... | 0 | 0 | 0 | 0 | 0 | 787 | 0 | -4 | 69 |
7ca0f088acdeb42080a4db65a5c97f9c26bb7b77 | 1,516 | py | Python | train_ik.py | meaten/MotionAug | ac7d5fa3e5ade1dffca8db50c1281e9a4a747b62 | [
"MIT"
] | 24 | 2022-03-18T08:03:11.000Z | 2022-03-30T05:11:26.000Z | train_ik.py | meaten/MotionAug | ac7d5fa3e5ade1dffca8db50c1281e9a4a747b62 | [
"MIT"
] | 1 | 2022-03-28T06:39:46.000Z | 2022-03-29T03:40:01.000Z | train_ik.py | meaten/MotionAug | ac7d5fa3e5ade1dffca8db50c1281e9a4a747b62 | [
"MIT"
] | null | null | null | import os
import subprocess
timeout = 60 * 60 * 8
bvh_dir = "data/bvh/hdm05_aligned_split/"
args = parse_args()
num_workers = args.num_workers
num_thread = args.num_threads
keyword = args.act_class
base_cmd = ["python3", "mpi_run.py",
"--arg_file", f"args/ik_fanshape_{keyword}.txt",
"--num_wo... | 32.255319 | 87 | 0.661609 | import os
import subprocess
import argparse
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument('--act_class', type=str)
parser.add_argument('--num_threads', type=int, default=5)
parser.add_argument('--num_workers', type=int, default=30)
args = parser.parse_args()
return a... | 0 | 0 | 0 | 0 | 0 | 257 | 0 | -6 | 45 |
2408651f34dc131b3f8b28ce96157a0d9577504d | 511 | py | Python | setup.py | toddsifleet/equals | fb2b2a027e5389fdeb2f59e9acbdcacb8a8cdfb4 | [
"MIT"
] | 38 | 2015-03-18T21:45:33.000Z | 2020-12-22T11:13:05.000Z | setup.py | toddsifleet/equals | fb2b2a027e5389fdeb2f59e9acbdcacb8a8cdfb4 | [
"MIT"
] | 8 | 2015-02-12T04:06:37.000Z | 2022-02-10T08:30:08.000Z | setup.py | toddsifleet/equals | fb2b2a027e5389fdeb2f59e9acbdcacb8a8cdfb4 | [
"MIT"
] | 4 | 2015-02-25T16:54:00.000Z | 2016-09-07T20:10:09.000Z | from setuptools import setup
import equals
with open('README.rst') as f:
long_description = f.read()
setup(
description='Python Fuzzy Matchers',
long_description=long_description,
name='equals',
version=equals.__version__,
author='Todd Sifleet',
author_email='todd.siflet@gmail.com',
p... | 25.55 | 106 | 0.706458 | from setuptools import setup
import equals
with open('README.rst') as f:
long_description = f.read()
setup(
description='Python Fuzzy Matchers',
long_description=long_description,
name='equals',
version=equals.__version__,
author='Todd Sifleet',
author_email='todd.siflet@gmail.com',
p... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7ad3a85969ac52e4c6aedb12277c91520ecca100 | 729 | py | Python | verificacaodeNotas.py | DevMarcus007/Programas_de_Teste_Para_Avaliacao | 20edb0a45d0afbe35282d8049940403b84b852a0 | [
"MIT"
] | null | null | null | verificacaodeNotas.py | DevMarcus007/Programas_de_Teste_Para_Avaliacao | 20edb0a45d0afbe35282d8049940403b84b852a0 | [
"MIT"
] | null | null | null | verificacaodeNotas.py | DevMarcus007/Programas_de_Teste_Para_Avaliacao | 20edb0a45d0afbe35282d8049940403b84b852a0 | [
"MIT"
] | null | null | null | #Verificao da mdia de 4 notas, e informao sobre Aprovao do aluno. Com retorno ao incio
print('*'*28)
print('CURSO SISTEMAS DE INFORMAO')
print('*'*28)
m=0
while True:
name = (input('Nome do Aluno: '))
c = 1
while c <=4:
n=float(input(f'{c} Nota: '))
m=m+n
c+=1
med=m/4... | 27 | 94 | 0.558299 | #Verificação da média de 4 notas, e informação sobre Aprovação do aluno. Com retorno ao início
print('*'*28)
print('CURSO SISTEMAS DE INFORMAÇÃO')
print('*'*28)
m=0
while True:
name = (input('Nome do Aluno: '))
c = 1
while c <=4:
n=float(input(f'{c}ª Nota: '))
m=m+n
c+=1
... | 36 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
58844052e38560172bb8e8863c013b71d8c0fc51 | 2,539 | py | Python | LB-Sandwich-on-Alicloud/base_config/config.py | yeukb/skillets | 262f51915f06a17c05cda0fbcda92b43cee4b8b5 | [
"MIT"
] | null | null | null | LB-Sandwich-on-Alicloud/base_config/config.py | yeukb/skillets | 262f51915f06a17c05cda0fbcda92b43cee4b8b5 | [
"MIT"
] | null | null | null | LB-Sandwich-on-Alicloud/base_config/config.py | yeukb/skillets | 262f51915f06a17c05cda0fbcda92b43cee4b8b5 | [
"MIT"
] | null | null | null | import requests
import xml.etree.ElementTree as ET
import argparse
import urllib3
from python_terraform import Terraform
#def install(package):
# subprocess.call([sys.executable, "-m", "pip", "install", package])
#
#install('python_terraform')
#try:
# from python_terraform import Terraform
#except ImportError:... | 30.963415 | 123 | 0.72627 | import requests
import xml.etree.ElementTree as ET
import argparse
import urllib3
import subprocess
import sys
from python_terraform import Terraform
#def install(package):
# subprocess.call([sys.executable, "-m", "pip", "install", package])
#
#install('python_terraform')
#try:
# from python_terraform import T... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -15 | 44 |
e830353a34e0cc635fa5ab4d37e70572aad53a48 | 1,109 | py | Python | 2020/07/17.py | frankpiva/leetcode | 85540af1fd72ad9e92c5a6ad253b1aaeec5065d9 | [
"MIT"
] | null | null | null | 2020/07/17.py | frankpiva/leetcode | 85540af1fd72ad9e92c5a6ad253b1aaeec5065d9 | [
"MIT"
] | null | null | null | 2020/07/17.py | frankpiva/leetcode | 85540af1fd72ad9e92c5a6ad253b1aaeec5065d9 | [
"MIT"
] | null | null | null | """
Top K Frequent Elements
Given a non-empty array of integers, return the k most frequent elements.
Example 1:
Input: nums = [1,1,1,2,2,3], k = 2
Output: [1,2]
Example 2:
Input: nums = [1], k = 1
Output: [1]
Note:
You may assume k is always valid, 1 k number of unique elements.
Your algorithm's time ... | 27.04878 | 111 | 0.603246 | """
Top K Frequent Elements
Given a non-empty array of integers, return the k most frequent elements.
Example 1:
Input: nums = [1,1,1,2,2,3], k = 2
Output: [1,2]
Example 2:
Input: nums = [1], k = 1
Output: [1]
Note:
You may assume k is always valid, 1 ≤ k ≤ number of unique elements.
Your algorithm's tim... | 6 | 0 | 0 | 425 | 0 | 0 | 0 | 0 | 22 |
2d095a60b83e20c7358961b49564ab9fdab362ff | 3,657 | py | Python | tb3_autonomy/python/tb3_behaviors/vision.py | xpharry/turtlebot3_behavior_demos | 992c50d310c493e450d584ee38b128ef55b0d2e0 | [
"MIT"
] | 41 | 2021-04-18T01:35:18.000Z | 2022-03-29T02:29:45.000Z | tb3_autonomy/python/tb3_behaviors/vision.py | xpharry/turtlebot3_behavior_demos | 992c50d310c493e450d584ee38b128ef55b0d2e0 | [
"MIT"
] | 2 | 2021-05-29T13:17:45.000Z | 2021-05-29T18:33:01.000Z | tb3_autonomy/python/tb3_behaviors/vision.py | xpharry/turtlebot3_behavior_demos | 992c50d310c493e450d584ee38b128ef55b0d2e0 | [
"MIT"
] | 9 | 2021-04-23T03:35:46.000Z | 2022-03-29T10:23:56.000Z | """
Vision behaviors for TurtleBot3
"""
# Define HSV color space thresholds
hsv_threshold_dict = {
"red": ((0, 220, 0), (30, 255, 255)),
"green": ((40, 220, 0), (80, 255, 255)),
"blue": ((100, 220, 0), (140, 255, 255)),
}
| 35.504854 | 99 | 0.621274 | """
Vision behaviors for TurtleBot3
"""
import cv2
import cv_bridge
import rospy
import py_trees
from sensor_msgs.msg import Image
import matplotlib.pyplot as plt
# Define HSV color space thresholds
hsv_threshold_dict = {
"red": ((0, 220, 0), (30, 255, 255)),
"green": ((40, 220, 0), (80, 255, 255)),
"blue... | 0 | 0 | 0 | 3,275 | 0 | 0 | 0 | -9 | 156 |
04493683e5cc3d4e6f17af8d5a55203823785bbe | 5,984 | py | Python | google/cloud/asset_v1p2beta1/proto/asset_service_pb2_grpc.py | vam-google/python-asset | dbf236ecd633a5fa5dd2371493425ef0adfcc266 | [
"Apache-2.0"
] | null | null | null | google/cloud/asset_v1p2beta1/proto/asset_service_pb2_grpc.py | vam-google/python-asset | dbf236ecd633a5fa5dd2371493425ef0adfcc266 | [
"Apache-2.0"
] | null | null | null | google/cloud/asset_v1p2beta1/proto/asset_service_pb2_grpc.py | vam-google/python-asset | dbf236ecd633a5fa5dd2371493425ef0adfcc266 | [
"Apache-2.0"
] | null | null | null | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
| 49.866667 | 140 | 0.758523 | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from google.cloud.asset_v1p2beta1.proto import (
asset_service_pb2 as google_dot_cloud_dot_asset__v1p2beta1_dot_proto_dot_asset__service__pb2,
)
from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
class Asse... | 0 | 0 | 0 | 3,544 | 0 | 2,060 | 0 | 171 | 136 |
73ebb7d4665072fe84700143216ebb0e6489b42f | 2,030 | py | Python | lbng/xorriso.py | adrian15/live-wrapper | 4c908cd1682f5d15912810a33c71c35a54fc7115 | [
"BSD-2-Clause"
] | 1 | 2016-01-05T17:29:13.000Z | 2016-01-05T17:29:13.000Z | lbng/xorriso.py | adrian15/live-wrapper | 4c908cd1682f5d15912810a33c71c35a54fc7115 | [
"BSD-2-Clause"
] | null | null | null | lbng/xorriso.py | adrian15/live-wrapper | 4c908cd1682f5d15912810a33c71c35a54fc7115 | [
"BSD-2-Clause"
] | null | null | null | # live-build-ng - Live-Build NG
# (C) Iain R. Learmonth 2015 <irl@debian.org>
# See COPYING for terms of usage, modification and redistribution.
#
# lbng/xorriso.py - xorriso helpers
"""
The lbng.xorriso module provides helpers for calling xorriso as part of the
image creation process.
.. note::
This module requi... | 31.71875 | 79 | 0.594581 | # live-build-ng - Live-Build NG
# (C) Iain R. Learmonth 2015 <irl@debian.org>
# See COPYING for terms of usage, modification and redistribution.
#
# lbng/xorriso.py - xorriso helpers
"""
The lbng.xorriso module provides helpers for calling xorriso as part of the
image creation process.
.. note::
This module requi... | 0 | 0 | 0 | 1,558 | 0 | 0 | 0 | 8 | 68 |
a88444b5d8e21a787190b016f91431fb59c4aa07 | 8,030 | py | Python | brane-ide/kernels/bscript/bscript_kernel/driver_pb2.py | romnn/brane | 03752edd85a09a5ffb817b9f6a0fa03c8e9b277a | [
"Apache-2.0"
] | null | null | null | brane-ide/kernels/bscript/bscript_kernel/driver_pb2.py | romnn/brane | 03752edd85a09a5ffb817b9f6a0fa03c8e9b277a | [
"Apache-2.0"
] | null | null | null | brane-ide/kernels/bscript/bscript_kernel/driver_pb2.py | romnn/brane | 03752edd85a09a5ffb817b9f6a0fa03c8e9b277a | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: driver.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf... | 33.319502 | 608 | 0.759402 | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: driver.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
db9db768de1234f47a531a57cf25915256070863 | 1,684 | py | Python | datacamp-master/22-introduction-to-time-series-analysis-in-python/03-autoregressive-ar-models/07-estimate-order-of-model-pacf.py | vitthal10/datacamp | 522d2b192656f7f6563bf6fc33471b048f1cf029 | [
"MIT"
] | 1 | 2021-01-31T20:51:10.000Z | 2021-01-31T20:51:10.000Z | 22-introduction-to-time-series-analysis-in-python/03-autoregressive-ar-models/07-estimate-order-of-model-pacf.py | AndreasFerox/DataCamp | 41525d7252f574111f4929158da1498ee1e73a84 | [
"MIT"
] | null | null | null | 22-introduction-to-time-series-analysis-in-python/03-autoregressive-ar-models/07-estimate-order-of-model-pacf.py | AndreasFerox/DataCamp | 41525d7252f574111f4929158da1498ee1e73a84 | [
"MIT"
] | 1 | 2021-08-08T05:09:52.000Z | 2021-08-08T05:09:52.000Z | '''
Estimate Order of Model: PACF
One useful tool to identify the order of an AR model is to look at the Partial Autocorrelation Function (PACF). In this exercise, you will simulate two time series, an AR(1) and an AR(2), and calculate the sample PACF for each. You will notice that for an AR(1), the PACF should have a... | 31.773585 | 444 | 0.75772 | '''
Estimate Order of Model: PACF
One useful tool to identify the order of an AR model is to look at the Partial Autocorrelation Function (PACF). In this exercise, you will simulate two time series, an AR(1) and an AR(2), and calculate the sample PACF for each. You will notice that for an AR(1), the PACF should have a... | 12 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ee4edb51e31c2c2fc17e7203d12af29e83814fd7 | 16,717 | py | Python | utils/Player.py | mrccniv/Platformer-AI-preing1-Project | 2fbb579d6ee478dc2eade85f741bcc9ee1fdb0f2 | [
"MIT"
] | 1 | 2022-02-14T09:12:51.000Z | 2022-02-14T09:12:51.000Z | utils/Player.py | mrccniv/Platformer-AI-preing1-Project | 2fbb579d6ee478dc2eade85f741bcc9ee1fdb0f2 | [
"MIT"
] | null | null | null | utils/Player.py | mrccniv/Platformer-AI-preing1-Project | 2fbb579d6ee478dc2eade85f741bcc9ee1fdb0f2 | [
"MIT"
] | null | null | null | # Classe de joueur
| 40.872861 | 158 | 0.536759 | import pygame
import random
import math
import sys
import numpy as np
from utils.Brain import Brain
from utils.settings import *
import names
# Classe de joueur
class Player(Brain):
def __init__(self, name="no_name", displaySprites=True):
Brain.__init__(self)
self.name = names.get_first_name() if... | 70 | 0 | 0 | 16,497 | 0 | 0 | 0 | -34 | 199 |
75c2498655ef34c9876c09c77e6bdae5a9a7366a | 3,912 | py | Python | Prototype 1/RoutingOldv2.py | Taechasit1001/AU_SeniorProject_1 | 1eea2fa0c9f195f45f5b6a48b7ffd232fcf1d293 | [
"MIT"
] | null | null | null | Prototype 1/RoutingOldv2.py | Taechasit1001/AU_SeniorProject_1 | 1eea2fa0c9f195f45f5b6a48b7ffd232fcf1d293 | [
"MIT"
] | null | null | null | Prototype 1/RoutingOldv2.py | Taechasit1001/AU_SeniorProject_1 | 1eea2fa0c9f195f45f5b6a48b7ffd232fcf1d293 | [
"MIT"
] | null | null | null |
# global variables
voiceMap = []
outPort = []
inPort = []
levelMap = [0, 31, 63, 95, 127]
| 30.325581 | 79 | 0.623978 |
from PySide6.QtCore import *
from PySide6.QtGui import *
from PySide6.QtWidgets import *
import mido
# global variables
voiceMap = []
outPort = []
inPort = []
levelMap = [0, 31, 63, 95, 127]
class reverbLevelCtrl:
reverbLevel = 0
msg = mido.Message.from_bytes([0xB0, 0x07, 0x00])
def onRevChanged(s... | 0 | 0 | 0 | 2,362 | 0 | 1,189 | 0 | 13 | 251 |
d47b83cfa5c20b4107312cfc97030d9d6a8f351b | 4,980 | py | Python | nlptk/duplicates/shingles/k_shingles.py | GarryGaller/nlp_toolkit | df98ee25f8a1f4379e751fdd4fd9f5389ffbfd1b | [
"MIT"
] | null | null | null | nlptk/duplicates/shingles/k_shingles.py | GarryGaller/nlp_toolkit | df98ee25f8a1f4379e751fdd4fd9f5389ffbfd1b | [
"MIT"
] | null | null | null | nlptk/duplicates/shingles/k_shingles.py | GarryGaller/nlp_toolkit | df98ee25f8a1f4379e751fdd4fd9f5389ffbfd1b | [
"MIT"
] | null | null | null | # , Web-
# http://rcdl2007.pereslavl.ru/papers/paper_65_v1.pdf
from collections import Counter
import binascii
import math
def compare_dice(a,b):
''' 2nt/na + nb.'''
a = set(a)
b = set(b)
common = a & b
dice = (len(common) * 2.0)/(len(a) + len(b))
return dice * 100 #
... | 24.411765 | 103 | 0.576908 | # Сегалович, Зеленков Сравнительный анализ методов определения нечетких дубликатов для Web-документов
# http://rcdl2007.pereslavl.ru/papers/paper_65_v1.pdf
from pprint import pprint
from collections import Counter
import binascii
import math
def compare_dice(a,b):
'''мера Дайса 2nt/na + nb.'''
a = set(a)
... | 1,995 | 0 | 0 | 0 | 654 | 615 | 0 | 4 | 150 |
ba6859b68776d3b4a528d8870ed3f994edb845d3 | 14,262 | py | Python | sss_object_detection/scripts/sim_tf_lines.py | ShounakCy/smarc_perception | 37de967be6246dbfd588608d7cbf77112c785ed3 | [
"BSD-3-Clause"
] | null | null | null | sss_object_detection/scripts/sim_tf_lines.py | ShounakCy/smarc_perception | 37de967be6246dbfd588608d7cbf77112c785ed3 | [
"BSD-3-Clause"
] | null | null | null | sss_object_detection/scripts/sim_tf_lines.py | ShounakCy/smarc_perception | 37de967be6246dbfd588608d7cbf77112c785ed3 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
if __name__ == '__main__':
main()
| 41.947059 | 141 | 0.650049 | #!/usr/bin/env python
import rospy
import numpy as np
import tf
import tf2_ros
import tf2_geometry_msgs
from nav_msgs.msg import Odometry
from vision_msgs.msg import ObjectHypothesisWithPose, Detection2DArray, Detection2D
from visualization_msgs.msg import Marker, MarkerArray
from std_msgs.msg import ColorRGBA
from ge... | 0 | 0 | 0 | 12,983 | 0 | 597 | 0 | 197 | 422 |
169f9c8edab47ec16880a28518bbf46727a59e02 | 427 | py | Python | detection/migrations/0006_file_name.py | omid-taj/Deepfake-Detection-Website | 8ba5cb5dda05df884a25120e7b2faffe900ca251 | [
"MIT"
] | 1 | 2021-08-01T00:17:56.000Z | 2021-08-01T00:17:56.000Z | detection/migrations/0006_file_name.py | omid-taj/Deepfake-Detection-Website | 8ba5cb5dda05df884a25120e7b2faffe900ca251 | [
"MIT"
] | 8 | 2021-03-30T13:17:39.000Z | 2022-03-12T00:28:19.000Z | detection/migrations/0006_file_name.py | omid-taj/Deepfake-Detection-Website | 8ba5cb5dda05df884a25120e7b2faffe900ca251 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.6 on 2020-05-06 16:48
| 22.473684 | 95 | 0.611241 | # Generated by Django 3.0.6 on 2020-05-06 16:48
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('detection', '0005_auto_20200506_0800'),
]
operations = [
migrations.AddField(
model_name='file',
name='name',
... | 0 | 0 | 0 | 313 | 0 | 0 | 0 | 19 | 46 |
c3b5e8b4c93fd023284385a4a696f9d207d93ace | 857 | py | Python | example.py | BaptisteLafoux/aztec_tiling | 413acd8751b8178942e91fbee32987f02bc5c695 | [
"MIT"
] | null | null | null | example.py | BaptisteLafoux/aztec_tiling | 413acd8751b8178942e91fbee32987f02bc5c695 | [
"MIT"
] | null | null | null | example.py | BaptisteLafoux/aztec_tiling | 413acd8751b8178942e91fbee32987f02bc5c695 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 30 22:20:17 2020
@author: baptistelafoux
"""
import shuffling_algorithm as sa
import matplotlib.pyplot as plt
import numpy as np
grid = {}
target_order = 75
curr_order = 1
while curr_order < target_order:
grid = sa.enlarge_grid(grid, cu... | 17.854167 | 57 | 0.656943 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 30 22:20:17 2020
@author: baptistelafoux
"""
import shuffling_algorithm as sa
import matplotlib.pyplot as plt
import numpy as np
grid = {}
target_order = 75
curr_order = 1
while curr_order < target_order:
grid = sa.enlarge_grid(grid, cu... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
bbd316f47c40f65d6b6963c13209cc43089cb1d8 | 5,747 | py | Python | iostat.py | tsuiter/salt-beacon-iostat | db87ad82e41a5627e2856928032e5d3e208158fc | [
"Apache-2.0"
] | null | null | null | iostat.py | tsuiter/salt-beacon-iostat | db87ad82e41a5627e2856928032e5d3e208158fc | [
"Apache-2.0"
] | null | null | null | iostat.py | tsuiter/salt-beacon-iostat | db87ad82e41a5627e2856928032e5d3e208158fc | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Beacon to transmit exceeding diskstat threshold
'''
# Import Python libs
from __future__ import absolute_import
import logging
# Import Salt libs
# Import Py3 compat
log = logging.getLogger(__name__)
__virtualname__ = 'iostat'
| 31.404372 | 208 | 0.667653 | # -*- coding: utf-8 -*-
'''
Beacon to transmit exceeding diskstat threshold
'''
# Import Python libs
from __future__ import absolute_import
import logging
import os
import re
# Import Salt libs
import salt.utils
# Import Py3 compat
from salt.ext.six.moves import zip
log = logging.getLogger(__name__)
__virtualname_... | 0 | 0 | 0 | 0 | 0 | 5,276 | 0 | -15 | 226 |
7084cd92cd4b110c4522cd5771ba1fada0fba253 | 17,622 | py | Python | restraintlib/lib/deoxyribose_purine.py | mkowiel/restraintlib | 32de01d67ae290a45f3199e90c729acc258a6249 | [
"BSD-3-Clause"
] | null | null | null | restraintlib/lib/deoxyribose_purine.py | mkowiel/restraintlib | 32de01d67ae290a45f3199e90c729acc258a6249 | [
"BSD-3-Clause"
] | 1 | 2021-11-11T18:45:10.000Z | 2021-11-11T18:45:10.000Z | restraintlib/lib/deoxyribose_purine.py | mkowiel/restraintlib | 32de01d67ae290a45f3199e90c729acc258a6249 | [
"BSD-3-Clause"
] | null | null | null | DEOXYRIBOSE_PURINE_PDB_CODES = ['DA', 'DG']
DEOXYRIBOSE_PURINE_ALL_PDB_CODES = DEOXYRIBOSE_PURINE_PDB_CODES
DEOXYRIBOSE_PURINE_CHI_GAMMA_PDB_CODES = DEOXYRIBOSE_PURINE_PDB_CODES
DEOXYRIBOSE_PURINE_CHI_PDB_CODES = DEOXYRIBOSE_PURINE_PDB_CODES
DEOXYRIBOSE_PURINE_BASE_FUNC_OF_TORSION_CHI_PDB_CODES = DEOXYRIBOSE_PURINE_PDB... | 59.938776 | 213 | 0.607139 | DEOXYRIBOSE_PURINE_PDB_CODES = ['DA', 'DG']
DEOXYRIBOSE_PURINE_ALL_PDB_CODES = DEOXYRIBOSE_PURINE_PDB_CODES
DEOXYRIBOSE_PURINE_CHI_GAMMA_PDB_CODES = DEOXYRIBOSE_PURINE_PDB_CODES
DEOXYRIBOSE_PURINE_CHI_PDB_CODES = DEOXYRIBOSE_PURINE_PDB_CODES
DEOXYRIBOSE_PURINE_BASE_FUNC_OF_TORSION_CHI_PDB_CODES = DEOXYRIBOSE_PURINE_PDB... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4a359b003d512ba7af0d82521f488c17a277d0a6 | 25,817 | py | Python | modules/stats.py | gmiranda/HTPC-Manager | 1db44826bb5344374c427d3c4ba1ca6b81910b13 | [
"MIT"
] | 1 | 2020-08-27T11:41:12.000Z | 2020-08-27T11:41:12.000Z | modules/stats.py | gmiranda/HTPC-Manager | 1db44826bb5344374c427d3c4ba1ca6b81910b13 | [
"MIT"
] | 4 | 2020-08-25T21:08:18.000Z | 2020-08-30T19:50:51.000Z | modules/stats.py | gmiranda/HTPC-Manager | 1db44826bb5344374c427d3c4ba1ca6b81910b13 | [
"MIT"
] | 2 | 2020-08-25T15:37:37.000Z | 2020-08-29T16:47:02.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import os
logger = logging.getLogger('modules.stats')
# Move to another file
def admin():
"""Determine whether this scrpt is running with administrative privilege.
### Returns:
* **(bool):** True if running as an administrator, False otherwise.
... | 37.524709 | 256 | 0.511988 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import time
import json
from datetime import datetime
import socket
import platform
import subprocess
import cherrypy
import htpc
import logging
import os
import requests
from htpc.auth2 import require, member_of
logger = logging.getLogger('modules.stats')
# Move to anot... | 0 | 19,291 | 0 | 4,640 | 0 | 0 | 0 | -39 | 270 |
0e4c8f67dc3c5c812235842db515867eaa954ca8 | 3,446 | py | Python | back_corr.py | rathsidd/MAT-I | 2484d20854451b6966b17691b1f65315977971e7 | [
"MIT"
] | 1 | 2020-06-22T19:33:55.000Z | 2020-06-22T19:33:55.000Z | back_corr.py | rathsidd/MAT-I | 2484d20854451b6966b17691b1f65315977971e7 | [
"MIT"
] | null | null | null | back_corr.py | rathsidd/MAT-I | 2484d20854451b6966b17691b1f65315977971e7 | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
import scipy as scp
import matplotlib as mpl
from skimage import morphology
import cv2
import matplotlib.pyplot as pyplot
%matplotlib inline
def bckgrnd_correc_rect(image, row_len, col_len):
"""Background correction using a rectangular structuring element. This function uses ... | 37.868132 | 113 | 0.741149 | import numpy as np
import pandas as pd
import scipy as scp
import matplotlib as mpl
from skimage import morphology
import cv2
import matplotlib.pyplot as pyplot
%matplotlib inline
def bckgrnd_correc_rect(image, row_len, col_len):
"""Background correction using a rectangular structuring element. This function uses ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b6f6cba04c95192eedb8de4a8cd97764c5fedc28 | 15,739 | py | Python | app.py | explojoe/elektronika_bot | a27c75ecfe677dcefeb5bb492435e7011bd15ef4 | [
"MIT"
] | null | null | null | app.py | explojoe/elektronika_bot | a27c75ecfe677dcefeb5bb492435e7011bd15ef4 | [
"MIT"
] | null | null | null | app.py | explojoe/elektronika_bot | a27c75ecfe677dcefeb5bb492435e7011bd15ef4 | [
"MIT"
] | null | null | null | import os
from flask import Flask
OAUTH2_CLIENT_ID = '456608429843283998' #os.environ['OAUTH2_CLIENT_ID']
OAUTH2_CLIENT_SECRET = '03D26-iZchBxx5ncJxN6fjxJkP6k0x-g' #os.environ['OAUTH2_CLIENT_SECRET']
OAUTH2_REDIRECT_URI = 'http://128.1932.254.226:5000/callback'
API_BASE_URL = os.environ.get('API_BASE_URL', 'https://d... | 32.995807 | 165 | 0.595781 | import os
import random
import time
import json
import datetime
from random import randint
from pyfiglet import figlet_format
from flask import Flask, g, session, redirect, request, url_for, jsonify
from requests_oauthlib import OAuth2Session
OAUTH2_CLIENT_ID = '456608429843283998' #os.environ['OAUTH2_CLIENT_ID']
OAUT... | 0 | 11,219 | 1,145 | 0 | 0 | 774 | 0 | 55 | 291 |
43e559c3212ebd2c48d54b34c2fd24dbd598e563 | 179 | py | Python | debutizer/commands/upload_targets/__init__.py | velovix/debutizer | a56f269881e70cd50feea32134b2fa0e0d93a20c | [
"BSD-3-Clause"
] | 2 | 2022-03-08T01:53:20.000Z | 2022-03-08T01:53:26.000Z | debutizer/commands/upload_targets/__init__.py | velovix/debutizer | a56f269881e70cd50feea32134b2fa0e0d93a20c | [
"BSD-3-Clause"
] | 64 | 2021-10-19T01:03:43.000Z | 2022-01-02T18:42:46.000Z | debutizer/commands/upload_targets/__init__.py | velovix/debutizer | a56f269881e70cd50feea32134b2fa0e0d93a20c | [
"BSD-3-Clause"
] | null | null | null | from .abstract import UploadTarget
from .ppa import PPAUploadTarget
from .s3 import S3UploadTarget
__all__ = [
"UploadTarget",
"PPAUploadTarget",
"S3UploadTarget",
]
| 17.9 | 34 | 0.73743 | from .abstract import UploadTarget
from .ppa import PPAUploadTarget
from .s3 import S3UploadTarget
__all__ = [
"UploadTarget",
"PPAUploadTarget",
"S3UploadTarget",
]
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
019380f6bd455c7bd4774660d695153598ded6cc | 2,954 | py | Python | src/onegov/reservation/collection.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/reservation/collection.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/reservation/collection.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null |
any_type = object()
| 32.108696 | 79 | 0.649628 | from onegov.core.utils import normalize_for_url
from onegov.reservation.models import Resource
from uuid import uuid4
any_type = object()
class ResourceCollection(object):
""" Manages a list of resources.
"""
def __init__(self, libres_context):
assert hasattr(libres_context, 'get_service'), """... | 0 | 0 | 0 | 2,790 | 0 | 0 | 0 | 52 | 89 |
e8be864a21312e28a9f4e1e7ee852395b169aa2e | 5,974 | py | Python | labs7_med_dash_project/rx_info/views.py | Lambda-School-Labs/CS10-medical-dashboard | 71a0acf4c45aab976797db60a3acf60c739e7e3e | [
"MIT"
] | 3 | 2018-09-13T22:49:33.000Z | 2018-09-27T23:35:43.000Z | labs7_med_dash_project/rx_info/views.py | Lambda-School-Labs/CS10-medical-dashboard | 71a0acf4c45aab976797db60a3acf60c739e7e3e | [
"MIT"
] | null | null | null | labs7_med_dash_project/rx_info/views.py | Lambda-School-Labs/CS10-medical-dashboard | 71a0acf4c45aab976797db60a3acf60c739e7e3e | [
"MIT"
] | 2 | 2018-09-20T21:04:11.000Z | 2019-03-21T21:44:15.000Z |
#from .models import rx_claim, CSVrxData
# Home page
# Background code page
# Local pharmay search page
# PBM search page
# Pharmacy results page
| 47.03937 | 145 | 0.718279 | from django.shortcuts import render
from . import forms
from .models import rx_claim
import pandas as pd
#from .models import rx_claim, CSVrxData
# Home page
def home(request):
return render(request, 'rx_info/home.html', {})
# Background code page
def background(request):
return render(request, 'rx_info/back... | 0 | 0 | 0 | 0 | 0 | 5,584 | 0 | 17 | 221 |
dfa21a96b8679ded9b510b90b3f0263256f25c92 | 583 | py | Python | tan-rad.py | sprightlyManifesto/cadQuery2 | 207a1ff2420210460539400dfd1945e8b7245497 | [
"MIT"
] | 1 | 2021-05-31T00:08:02.000Z | 2021-05-31T00:08:02.000Z | tan-rad.py | sprightlyManifesto/cadQuery2 | 207a1ff2420210460539400dfd1945e8b7245497 | [
"MIT"
] | null | null | null | tan-rad.py | sprightlyManifesto/cadQuery2 | 207a1ff2420210460539400dfd1945e8b7245497 | [
"MIT"
] | null | null | null | from math import sin, cos, pi
cutAngle = 100
cutBase = 1
cutWidth = 8
cutRad = 0.2
x1,y1 = -cutBase/2 , 0
theta = pi*(cutAngle/2)/180
rtheta = (pi/2 - theta)
log(rtheta*180/pi)
x2,y2 = (-cutRad * sin(rtheta) + x1 , cutRad - cutRad * cos(rtheta))
x3,y3 = -cutWidth/2, (cutWidth/2- y2)*sin(rtheta)
log(f"x2:{round(x2,... | 27.761905 | 102 | 0.662093 | from cadquery import *
from math import sin,cos,pi
cutAngle = 100
cutBase = 1
cutWidth = 8
cutRad = 0.2
x1,y1 = -cutBase/2 , 0
theta = pi*(cutAngle/2)/180
rtheta = (pi/2 - theta)
log(rtheta*180/pi)
x2,y2 = (-cutRad * sin(rtheta) + x1 , cutRad - cutRad * cos(rtheta))
x3,y3 = -cutWidth/2, (cutWidth/2- y2)*sin(rtheta... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -1 | 22 |
e43c667878c1fb44376c0d94679f2dd468266a63 | 1,102 | py | Python | src/trw/datasets/utils.py | civodlu/trw | b9a1cf045f61d6df9c65c014ef63b4048972dcdc | [
"MIT"
] | 3 | 2019-07-04T01:20:41.000Z | 2020-01-27T02:36:12.000Z | src/trw/datasets/utils.py | civodlu/trw | b9a1cf045f61d6df9c65c014ef63b4048972dcdc | [
"MIT"
] | null | null | null | src/trw/datasets/utils.py | civodlu/trw | b9a1cf045f61d6df9c65c014ef63b4048972dcdc | [
"MIT"
] | 2 | 2020-10-19T13:46:06.000Z | 2021-12-27T02:18:10.000Z | from PIL.Image import Image
| 29 | 95 | 0.678766 | import numpy as np
import torch
from PIL.Image import Image
from PIL import Image
import torchvision
def pic_to_tensor(pic: Image) -> torch.Tensor:
assert isinstance(pic, Image), 'image must be a PIL Image'
i = np.array(pic)
if len(i.shape) == 2:
i = np.reshape(i, [i.shape[0], i.shape[1], 1])
... | 0 | 0 | 0 | 0 | 0 | 929 | 0 | -15 | 157 |
d193971fddcbd7411b4d55a4b6316790b093ebd3 | 1,598 | py | Python | plugins/palo_alto_cortex_xdr/icon_palo_alto_cortex_xdr/actions/isolate_endpoint/action.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 46 | 2019-06-05T20:47:58.000Z | 2022-03-29T10:18:01.000Z | plugins/palo_alto_cortex_xdr/icon_palo_alto_cortex_xdr/actions/isolate_endpoint/action.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 386 | 2019-06-07T20:20:39.000Z | 2022-03-30T17:35:01.000Z | plugins/palo_alto_cortex_xdr/icon_palo_alto_cortex_xdr/actions/isolate_endpoint/action.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 43 | 2019-07-09T14:13:58.000Z | 2022-03-28T12:04:46.000Z |
# Custom imports below
| 42.052632 | 128 | 0.694618 | import insightconnect_plugin_runtime
from .schema import IsolateEndpointInput, IsolateEndpointOutput, Input, Output, Component
# Custom imports below
from insightconnect_plugin_runtime.exceptions import PluginException
from time import sleep
class IsolateEndpoint(insightconnect_plugin_runtime.Action):
def __init... | 0 | 0 | 0 | 1,331 | 0 | 0 | 0 | 131 | 111 |
721511e93bbd906c6644ab97531e22339bea98e2 | 172 | py | Python | tkinter/minimal - function version/main-2.py | whitmans-max/python-examples | 881a8f23f0eebc76816a0078e19951893f0daaaa | [
"MIT"
] | 140 | 2017-02-21T22:49:04.000Z | 2022-03-22T17:51:58.000Z | tkinter/minimal - function version/main-2.py | whitmans-max/python-examples | 881a8f23f0eebc76816a0078e19951893f0daaaa | [
"MIT"
] | 5 | 2017-12-02T19:55:00.000Z | 2021-09-22T23:18:39.000Z | tkinter/minimal - function version/main-2.py | whitmans-max/python-examples | 881a8f23f0eebc76816a0078e19951893f0daaaa | [
"MIT"
] | 79 | 2017-01-25T10:53:33.000Z | 2022-03-11T16:13:57.000Z | #!/usr/bin/env python
try:
import Tkinter as tk # Python 2
except:
import tkinter as tk # Python 3
root = tk.Tk()
# all functions put here
root.mainloop()
| 13.230769 | 35 | 0.645349 | #!/usr/bin/env python
try:
import Tkinter as tk # Python 2
except:
import tkinter as tk # Python 3
root = tk.Tk()
# all functions put here
root.mainloop()
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
dfd9b1e75ed2fc966b5408c91275f7a5d91b32c5 | 223 | py | Python | appengine_config.py | johanalexandersson91/job_interview | e8fca4d09788232e807bf7c872a3a3b227f230f8 | [
"MIT"
] | null | null | null | appengine_config.py | johanalexandersson91/job_interview | e8fca4d09788232e807bf7c872a3a3b227f230f8 | [
"MIT"
] | null | null | null | appengine_config.py | johanalexandersson91/job_interview | e8fca4d09788232e807bf7c872a3a3b227f230f8 | [
"MIT"
] | null | null | null | from google.appengine.ext import ndb
from google.appengine.ext import vendor
context = ndb.get_context()
context.set_cache_policy(lambda key: False)
context.set_memcache_policy(lambda key: False)
vendor.add('backend/lib') | 27.875 | 46 | 0.816143 | from google.appengine.ext import ndb
from google.appengine.ext import vendor
context = ndb.get_context()
context.set_cache_policy(lambda key: False)
context.set_memcache_policy(lambda key: False)
vendor.add('backend/lib') | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0e091e83d228d2edb7bcf2d74efd0ad8145f49f6 | 583 | py | Python | producers/config.py | gurleen/dtv-gfx-next | 529c226a30c9b668a44e2a2470c3593287867caf | [
"MIT"
] | null | null | null | producers/config.py | gurleen/dtv-gfx-next | 529c226a30c9b668a44e2a2470c3593287867caf | [
"MIT"
] | null | null | null | producers/config.py | gurleen/dtv-gfx-next | 529c226a30c9b668a44e2a2470c3593287867caf | [
"MIT"
] | null | null | null | import os
import sys
from pathlib import Path
if getattr("sys", "frozen", False):
app_path = sys._MEIPASS
else:
app_path = Path(os.path.dirname(os.path.abspath(__file__))).parent
| 24.291667 | 78 | 0.682676 | import os
import sys
from pathlib import Path
from janus import Queue
import aiofiles
from loguru import logger
from .decorator import producer
if getattr("sys", "frozen", False):
app_path = sys._MEIPASS
else:
app_path = Path(os.path.dirname(os.path.abspath(__file__))).parent
@producer
async def read_from_... | 0 | 271 | 0 | 0 | 0 | 0 | 0 | 10 | 112 |
5cf8cbea5af960f8c09d506f40ecfe407a7b0ce5 | 1,813 | py | Python | Algorithms/Selection-Sort/Python/main.py | KumarjitDas/Algorithms | aec0b7b853bb4a2f4d81a6a04236402baf2af7f7 | [
"MIT"
] | null | null | null | Algorithms/Selection-Sort/Python/main.py | KumarjitDas/Algorithms | aec0b7b853bb4a2f4d81a6a04236402baf2af7f7 | [
"MIT"
] | null | null | null | Algorithms/Selection-Sort/Python/main.py | KumarjitDas/Algorithms | aec0b7b853bb4a2f4d81a6a04236402baf2af7f7 | [
"MIT"
] | null | null | null | import random
def find_shortest(array: list[int]) -> int:
""" Find the shortest element in an array.
find_shortest
=============
The `find_shortest` function takes an array and finds the shortest element
in it.
Parameters
----------
array: list[int]
An array/list of integers
Retu... | 24.835616 | 119 | 0.540541 | import random
def find_shortest(array: list[int]) -> int:
""" Find the shortest element in an array.
find_shortest
=============
The `find_shortest` function takes an array and finds the shortest element
in it.
Parameters
----------
array: list[int]
An array/list of integers
Retu... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
77ece26b4baa06da181d56cf4230de39c42cc7dd | 1,322 | py | Python | neodroidaudition/audio_utilities/persistence.py | cnheider/audition | fe65285d0c8befe2141bb0a2789b23e2e079e651 | [
"Apache-2.0"
] | 1 | 2021-12-17T01:46:31.000Z | 2021-12-17T01:46:31.000Z | neodroidaudition/audio_utilities/persistence.py | cnheider/audition | fe65285d0c8befe2141bb0a2789b23e2e079e651 | [
"Apache-2.0"
] | null | null | null | neodroidaudition/audio_utilities/persistence.py | cnheider/audition | fe65285d0c8befe2141bb0a2789b23e2e079e651 | [
"Apache-2.0"
] | 2 | 2021-01-31T14:58:08.000Z | 2021-01-31T14:58:23.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'Christian Heider Nielsen'
__doc__ = r'''
Created on 17-12-2020
'''
| 23.192982 | 63 | 0.580938 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'Christian Heider Nielsen'
__doc__ = r'''
Created on 17-12-2020
'''
import os
import numpy
import soundfile
def audio_read(path, norm=True, start=0, stop=None):
path = os.path.abspath(path)
if not os.path.exists(path):
raise... | 0 | 0 | 0 | 0 | 0 | 1,080 | 0 | -26 | 114 |
0649ab434e2e5c47b50a36e0856893b57ace6c94 | 5,043 | py | Python | isip/utils.py | TheRipperJhon/Isip | fad1f10b02f9e075451588cc6a18a46cc5fbd66b | [
"MIT"
] | 60 | 2017-12-01T14:46:01.000Z | 2022-02-22T19:17:42.000Z | isip/utils.py | TheRipperJhon/Isip | fad1f10b02f9e075451588cc6a18a46cc5fbd66b | [
"MIT"
] | null | null | null | isip/utils.py | TheRipperJhon/Isip | fad1f10b02f9e075451588cc6a18a46cc5fbd66b | [
"MIT"
] | 16 | 2018-11-05T13:21:30.000Z | 2021-04-26T17:36:30.000Z | # The MIT License (MIT)
# Copyright (c) 2014 Halit Alptekin
#
# 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... | 24.014286 | 119 | 0.565536 | # The MIT License (MIT)
# Copyright (c) 2014 Halit Alptekin
#
# 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... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8c2a59561cbf918616b780849f51cfad01f31e7a | 11,859 | py | Python | plugins/scheduler.py | bisnuray/Music_Player | 82c86fedebf3b89d9874e765804888861d5b059a | [
"MIT"
] | 2 | 2021-10-05T18:57:25.000Z | 2021-10-06T06:40:23.000Z | plugins/scheduler.py | bisnuray/Music_Player | 82c86fedebf3b89d9874e765804888861d5b059a | [
"MIT"
] | null | null | null | plugins/scheduler.py | bisnuray/Music_Player | 82c86fedebf3b89d9874e765804888861d5b059a | [
"MIT"
] | 3 | 2021-10-05T18:57:29.000Z | 2021-10-14T06:22:27.000Z | import pytz
from config import Config
from pyrogram import (filters)
from pyrogram.types import (InlineKeyboardButton, InlineKeyboardMarkup)
from utils import (is_admin)
IST = pytz.timezone(Config.TIME_ZONE)
admin_filter=filters.create(is_admin)
| 41.177083 | 245 | 0.555527 |
from logger import LOGGER
import re
import calendar
from datetime import datetime
from contextlib import suppress
import pytz
from config import Config
from youtube_search import YoutubeSearch
from youtube_dl import YoutubeDL
from pyrogram import(
Client,
filters
)
from pyrogram.types import (
InlineK... | 54 | 11,024 | 0 | 0 | 0 | 0 | 0 | 269 | 292 |
a500013cab86276c0e07533d0ab2779631f99b3d | 316 | py | Python | zero.py | SolarLiner/django-node | 0d094301c57fdcd9369dfe40a87566c7092a25d9 | [
"MIT"
] | null | null | null | zero.py | SolarLiner/django-node | 0d094301c57fdcd9369dfe40a87566c7092a25d9 | [
"MIT"
] | null | null | null | zero.py | SolarLiner/django-node | 0d094301c57fdcd9369dfe40a87566c7092a25d9 | [
"MIT"
] | null | null | null | import time
import zmq
context = zmq.Context()
socket = context.socket(zmq.REQ)
socket.connect("tcp://localhost:5000")
print("Client started")
i = 0
while True:
socket.send_string(f"Current iteration is: {i}")
msg = socket.recv_string()
print("Received message %s" % msg)
time.sleep(1)
i += 1
| 18.588235 | 52 | 0.670886 | import time
import zmq
context = zmq.Context()
socket = context.socket(zmq.REQ)
socket.connect("tcp://localhost:5000")
print("Client started")
i = 0
while True:
socket.send_string(f"Current iteration is: {i}")
msg = socket.recv_string()
print("Received message %s" % msg)
time.sleep(1)
i += 1
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
fa21546f11e712e38c3e3def6d68463ed8c2db57 | 6,743 | py | Python | hardhat/recipes/python/base.py | stangelandcl/hardhat | 1ad0c5dec16728c0243023acb9594f435ef18f9c | [
"MIT"
] | null | null | null | hardhat/recipes/python/base.py | stangelandcl/hardhat | 1ad0c5dec16728c0243023acb9594f435ef18f9c | [
"MIT"
] | null | null | null | hardhat/recipes/python/base.py | stangelandcl/hardhat | 1ad0c5dec16728c0243023acb9594f435ef18f9c | [
"MIT"
] | null | null | null |
# Unused - trial code
| 29.968889 | 78 | 0.564141 | import json
import os
import re
import shutil
from string import Template
from ..base import Downloader, Recipe, Configure, Make, MakeInstall
from ..base import TarballRecipe, GnuRecipe, GetVersionMixin
from hardhat.util import run, read_url, Object
from hardhat.urls import Urls
from hardhat.version import Versions, ex... | 0 | 982 | 0 | 4,395 | 0 | 890 | 0 | 114 | 334 |
96f32ba1f46ec2964e4253b050fa840cc0918f28 | 9,991 | py | Python | checks/bundled/lparstats/tests/conftest.py | ian28223/datadog-unix-agent | 09c75778b512361c83ff10e7cdb37b887bcaa8fe | [
"Apache-2.0"
] | 13 | 2018-08-11T01:40:51.000Z | 2022-01-02T09:07:43.000Z | checks/bundled/lparstats/tests/conftest.py | ian28223/datadog-unix-agent | 09c75778b512361c83ff10e7cdb37b887bcaa8fe | [
"Apache-2.0"
] | 21 | 2018-05-28T13:16:23.000Z | 2021-08-19T15:43:40.000Z | checks/bundled/lparstats/tests/conftest.py | ian28223/datadog-unix-agent | 09c75778b512361c83ff10e7cdb37b887bcaa8fe | [
"Apache-2.0"
] | 15 | 2018-05-10T15:09:41.000Z | 2022-03-21T06:46:21.000Z | # Unless explicitly stated otherwise all files in this repository are licensed
# under the Apache License Version 2.0.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2018 Datadog, Inc.
import utils.process
ORIGINAL_SUBPROC_OUTPUT = utils.process.get_subprocess_output
... | 59.118343 | 99 | 0.367231 | # Unless explicitly stated otherwise all files in this repository are licensed
# under the Apache License Version 2.0.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2018 Datadog, Inc.
import pytest
import utils.process
ORIGINAL_SUBPROC_OUTPUT = utils.process.get_sub... | 0 | 301 | 0 | 0 | 0 | 276 | 0 | -8 | 69 |
1f5d84e5a1f4bdb8a4808ca76519630af14b9cf3 | 1,124 | py | Python | build_tooling/tooling.py | mgeerdsen/dockerfiles | 584cfbe65cf8ca1cbea2d0b4ddf2723aa0ab3b13 | [
"MIT"
] | 1 | 2019-10-22T18:24:56.000Z | 2019-10-22T18:24:56.000Z | build_tooling/tooling.py | mgeerdsen/dockerfiles | 584cfbe65cf8ca1cbea2d0b4ddf2723aa0ab3b13 | [
"MIT"
] | 10 | 2018-02-08T15:43:51.000Z | 2019-08-23T11:48:24.000Z | build_tooling/tooling.py | wellcomecollection/dockerfiles | 9ca5fe6fc5abda232ab641dc2d13b81999e746a4 | [
"MIT"
] | 4 | 2018-09-10T09:49:25.000Z | 2019-01-17T14:53:03.000Z | # -*- encoding: utf-8 -*-
import os
import subprocess
# Root of the Git repository
ROOT = subprocess.check_output([
'git', 'rev-parse', '--show-toplevel']).decode('ascii').strip()
# Hash of the current commit
CURRENT_COMMIT = subprocess.check_output([
'git', 'rev-parse', 'HEAD']).decode('ascii').strip()
de... | 25.545455 | 74 | 0.66548 | # -*- encoding: utf-8 -*-
import errno
import os
import shlex
import subprocess
# Root of the Git repository
ROOT = subprocess.check_output([
'git', 'rev-parse', '--show-toplevel']).decode('ascii').strip()
# Hash of the current commit
CURRENT_COMMIT = subprocess.check_output([
'git', 'rev-parse', 'HEAD']).d... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -18 | 45 |
3bebdba244e574fd0522b81ced463b1608b0c1df | 2,408 | py | Python | imstegan/algo/edge.py | trantuan4132/imstegan | b70fd9b8fbcdaebeb630f42033b992fdccb5006d | [
"MIT"
] | 7 | 2022-03-10T06:43:25.000Z | 2022-03-10T08:29:01.000Z | imstegan/algo/edge.py | trantuan4132/imstegan | b70fd9b8fbcdaebeb630f42033b992fdccb5006d | [
"MIT"
] | null | null | null | imstegan/algo/edge.py | trantuan4132/imstegan | b70fd9b8fbcdaebeb630f42033b992fdccb5006d | [
"MIT"
] | null | null | null |
__all__ = ["SobelLSB"]
| 35.411765 | 101 | 0.565615 | import warnings
from typing import Any
import numpy as np
from ..utils import message_to_binary, binary_to_message, rgb_to_gray, conv2d
__all__ = ["SobelLSB"]
def _to_grayscale(image):
if image.ndim > 2:
if image.shape[2] == 3:
img = rgb_to_gray(image)
warnings.warn("Image is R... | 0 | 0 | 0 | 1,910 | 0 | 288 | 0 | 48 | 136 |
c35862053eab88650dbbfc600232cf1398bd80f2 | 257 | py | Python | web_ui/models.py | cisco-gve/epnm_usage_tool | e67fbdd80d7d51b110c317db4935120dd19781b9 | [
"Apache-2.0"
] | 2 | 2019-11-26T07:50:58.000Z | 2020-01-13T17:32:05.000Z | web_ui/models.py | gve-sw/epnm_usage_tool | e67fbdd80d7d51b110c317db4935120dd19781b9 | [
"Apache-2.0"
] | null | null | null | web_ui/models.py | gve-sw/epnm_usage_tool | e67fbdd80d7d51b110c317db4935120dd19781b9 | [
"Apache-2.0"
] | 2 | 2017-10-12T23:00:51.000Z | 2018-03-02T13:40:46.000Z |
# Create your models here.
| 16.0625 | 30 | 0.63035 | from django.db import models
# Create your models here.
class epnm_info(models.Model):
host = ''
user = ''
password = ''
def get_info(self):
r_dict={
'host' : self.host,
'user' : self.user,
'password' : self.password,
}
return r_dict
| 0 | 0 | 0 | 178 | 0 | 0 | 0 | 7 | 44 |
f5924c6c305eb74700484a8beaea8d76b80eae13 | 1,222 | py | Python | arkham.py | hardingalexh/agent-of-the-king | 72beca960cd3d9ac8a16dde7750156662b2788c0 | [
"Apache-2.0"
] | 3 | 2020-12-21T04:37:43.000Z | 2020-12-21T22:59:11.000Z | arkham.py | hardingalexh/agent-of-the-king | 72beca960cd3d9ac8a16dde7750156662b2788c0 | [
"Apache-2.0"
] | 5 | 2019-09-27T13:20:20.000Z | 2019-09-27T13:25:11.000Z | arkham.py | hardingalexh/agent-of-the-king | 72beca960cd3d9ac8a16dde7750156662b2788c0 | [
"Apache-2.0"
] | null | null | null | import os
import discord
from discord.ext import commands
from cogs.arkhamdb import Arkhamdb
from cogs.dice import Dice
from cogs.bag import Bag
from cogs.blob import Blob
from cogs.funko import Funko
from cogs.marvelcdb import Marvelcdb
from dotenv import load_dotenv
load_dotenv()
token = os.getenv('DISCORD_TOKEN'... | 26.565217 | 81 | 0.718494 | import os
import random
import re
import requests
import discord
from discord.ext import commands
from cogs.arkhamdb import Arkhamdb
from cogs.dice import Dice
from cogs.bag import Bag
from cogs.blob import Blob
from cogs.funko import Funko
from cogs.marvelcdb import Marvelcdb
from dotenv import load_dotenv
load_do... | 0 | 608 | 0 | 0 | 0 | 0 | 0 | -26 | 89 |
bca3f39a6b2321f3d4a06e75611b6bbc5ce62cfe | 3,395 | py | Python | andrei/reinforce.py | andrei-radulescu-banu/SLM-Lab | fd6e1a177550f4cb5a7f36e25e80c68470e4848c | [
"MIT"
] | null | null | null | andrei/reinforce.py | andrei-radulescu-banu/SLM-Lab | fd6e1a177550f4cb5a7f36e25e80c68470e4848c | [
"MIT"
] | null | null | null | andrei/reinforce.py | andrei-radulescu-banu/SLM-Lab | fd6e1a177550f4cb5a7f36e25e80c68470e4848c | [
"MIT"
] | null | null | null | import torch.nn as nn
import torch.optim as optim
gamma = 0.99
if __name__ == '__main__':
main()
| 42.4375 | 128 | 0.653314 | from torch.distributions import Categorical
import gym
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
gamma = 0.99
class Pi(nn.Module):
def __init__(self, in_dim, out_dim):
super(Pi, self).__init__()
layers = [
nn.Linear(in_dim, 64), # in_dim number o... | 0 | 0 | 0 | 1,093 | 0 | 2,031 | 0 | -1 | 165 |
72b10da32ea2bbe990f09f48c31aa0a30ba4dabe | 187 | py | Python | 05-iterator-generator/generator_expm_3.py | saidulislam/Python-Experiment | 0f63e0e6682b7a4d09f01a60adc926de2111e930 | [
"Apache-2.0"
] | null | null | null | 05-iterator-generator/generator_expm_3.py | saidulislam/Python-Experiment | 0f63e0e6682b7a4d09f01a60adc926de2111e930 | [
"Apache-2.0"
] | null | null | null | 05-iterator-generator/generator_expm_3.py | saidulislam/Python-Experiment | 0f63e0e6682b7a4d09f01a60adc926de2111e930 | [
"Apache-2.0"
] | null | null | null | gen = silly_generator()
for item in gen:
print(item)
# #Python
# #Rocks
# #So do you! | 14.384615 | 24 | 0.57754 | def silly_generator():
yield "Python"
yield "Rocks"
yield "So do you!"
gen = silly_generator()
for item in gen:
print(item)
# #Python
# #Rocks
# #So do you! | 0 | 0 | 0 | 0 | 64 | 0 | 0 | 0 | 23 |
3024c38f69f8a1a0badb9bcbaabe275a5deb98fb | 6,433 | py | Python | Editor/dist_pini.py | RangHo/pini-engine | e1407724de32a433b7b46e0ee2469240b70d960b | [
"MIT"
] | null | null | null | Editor/dist_pini.py | RangHo/pini-engine | e1407724de32a433b7b46e0ee2469240b70d960b | [
"MIT"
] | null | null | null | Editor/dist_pini.py | RangHo/pini-engine | e1407724de32a433b7b46e0ee2469240b70d960b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import os, sys, shutil
import zipfile, glob, subprocess
import traceback
try:
option = {
"stdout":subprocess.PIPE,
"stderr":subprocess.PIPE
}
cwd = os.path.abspath(os.path.dirname(__file__))
print "c",cwd,__file__
if len(cwd) == 0:
cwd = "."
sys.path.append(myjoin(cwd,"..","Engine... | 30.927885 | 105 | 0.675734 | # -*- coding: utf-8 -*-
import os,sys,shutil
import zipfile,glob,subprocess
import traceback
def u(text):
return unicode(text,"utf-8")
def myjoin(*args):
path = os.path.join(*args)
path = os.path.abspath(path)
return path
def luaCompileWithLuac(desc,path):
try:
for dirname, dirnames, filenames in os.walk(path... | 0 | 0 | 0 | 0 | 0 | 797 | 0 | -4 | 92 |
fc054ef3c68de857b1b477a7bee7d0643dfda0e3 | 79 | py | Python | api/wsgi.py | ubirch/qrcode-decoder-playground | 33472ede29b0e605a8fa140bea1605ab515da0b5 | [
"Apache-2.0"
] | null | null | null | api/wsgi.py | ubirch/qrcode-decoder-playground | 33472ede29b0e605a8fa140bea1605ab515da0b5 | [
"Apache-2.0"
] | null | null | null | api/wsgi.py | ubirch/qrcode-decoder-playground | 33472ede29b0e605a8fa140bea1605ab515da0b5 | [
"Apache-2.0"
] | null | null | null | from .app import app
# production specific config
app.config['DEBUG'] = False
| 15.8 | 28 | 0.746835 | from .app import app
# production specific config
app.config['DEBUG'] = False
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6381c62ea53007521248f046a84c975b44bba846 | 648 | py | Python | game_of_life/utilities.py | ziebam/game_of_life | 380df75cdb3b94ef967f3c11e1c749bca4a178ea | [
"MIT"
] | 1 | 2020-07-28T18:55:35.000Z | 2020-07-28T18:55:35.000Z | game_of_life/utilities.py | ziebam/game_of_life | 380df75cdb3b94ef967f3c11e1c749bca4a178ea | [
"MIT"
] | null | null | null | game_of_life/utilities.py | ziebam/game_of_life | 380df75cdb3b94ef967f3c11e1c749bca4a178ea | [
"MIT"
] | null | null | null | """The project's utilities.
This module provides utility functions that don't fit any other module.
"""
from typing import List
def load_board_state(path_to_file: str) -> List[List[int]]:
"""Loads the initial board state from file.
Args:
path_to_file: A path to the file, preferably constructed with... | 23.142857 | 71 | 0.640432 | """The project's utilities.
This module provides utility functions that don't fit any other module.
"""
from typing import List
def load_board_state(path_to_file: str) -> List[List[int]]:
"""Loads the initial board state from file.
Args:
path_to_file: A path to the file, preferably constructed with... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d47c2e2a44e909d75bfe38be8a3565f0fb33cee9 | 3,015 | py | Python | test/test.py | luclepot/unknownpasta | 53cff8ff92b9d986d06753f2fa4bbacf7138d689 | [
"MIT"
] | null | null | null | test/test.py | luclepot/unknownpasta | 53cff8ff92b9d986d06753f2fa4bbacf7138d689 | [
"MIT"
] | null | null | null | test/test.py | luclepot/unknownpasta | 53cff8ff92b9d986d06753f2fa4bbacf7138d689 | [
"MIT"
] | null | null | null | import unknownpasta
# call lucs_tools.formatting.joyful.joy_text to plot the string
# lucs_tools.formatting.joyful.text(
# input_string,
# 90,
# fontsize=5.5,
# weight='light',
# factor=3.,
# write_lines=True,
# )
# text = """it was a good run. A new coach to soccer that coaching r... | 75.375 | 786 | 0.740962 | import unknownpasta
import numpy as np
import matplotlib.pyplot as plt
# call lucs_tools.formatting.joyful.joy_text to plot the string
# lucs_tools.formatting.joyful.text(
# input_string,
# 90,
# fontsize=5.5,
# weight='light',
# factor=3.,
# write_lines=True,
# )
# text = """it ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 | 46 |
409e7e1253cfd3d06bf144565ce92b083d219a29 | 1,878 | py | Python | setup.py | thejoeejoee/django-allauth-cas | 5db34b546eb32524a3a1a4b90f411e370ac7ad9b | [
"MIT"
] | null | null | null | setup.py | thejoeejoee/django-allauth-cas | 5db34b546eb32524a3a1a4b90f411e370ac7ad9b | [
"MIT"
] | null | null | null | setup.py | thejoeejoee/django-allauth-cas | 5db34b546eb32524a3a1a4b90f411e370ac7ad9b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import os
from setuptools import find_packages, setup
from allauth_cas import __version__
BASE_DIR = os.path.dirname(__file__)
with open(os.path.join(BASE_DIR, 'README.rst')) as readme:
README = readme.read()
setup(
name='django-allauth-cas',
version=__version__,
description... | 31.3 | 58 | 0.586794 | # -*- coding: utf-8 -*-
import os
from setuptools import find_packages, setup
from allauth_cas import __version__
BASE_DIR = os.path.dirname(__file__)
with open(os.path.join(BASE_DIR, 'README.rst')) as readme:
README = readme.read()
setup(
name='django-allauth-cas',
version=__version__,
description... | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
db35cb48422eff7f5bdb79383c7972928ec9d7e0 | 1,677 | py | Python | pwnypack/shellcode/arm/thumb.py | iksteen/dpf | e0a5a8e6ef3f4f1f7e1b91ee379711f4a49cb0e6 | [
"MIT"
] | 133 | 2015-04-07T07:37:49.000Z | 2022-01-12T13:34:34.000Z | pwnypack/shellcode/arm/thumb.py | iksteen/dpf | e0a5a8e6ef3f4f1f7e1b91ee379711f4a49cb0e6 | [
"MIT"
] | 3 | 2016-04-21T12:40:21.000Z | 2019-04-04T10:11:53.000Z | pwnypack/shellcode/arm/thumb.py | iksteen/dpf | e0a5a8e6ef3f4f1f7e1b91ee379711f4a49cb0e6 | [
"MIT"
] | 31 | 2015-05-28T03:34:14.000Z | 2020-06-20T08:54:02.000Z |
__all__ = ['ARMThumb']
| 32.25 | 82 | 0.55814 | from pwnypack.shellcode.arm import ARM
from pwnypack.target import Target
__all__ = ['ARMThumb']
class ARMThumb(ARM):
"""
Environment that targets a generic, unrestricted ARM architecture using
the Thumb instruction set.
"""
def __init__(self, endian=None, *args, **kwargs):
super(ARMThu... | 0 | 0 | 0 | 1,554 | 0 | 0 | 0 | 30 | 67 |
d949a0bb9cffeed582f6f13c4cb0450d0658354a | 1,045 | py | Python | adoctor-diag-executor/adoctor_diag_executor/conf/default_config.py | seandong37tt4qu/jeszhengq | 32b3737ab45e89e8c5b71cdce871cefd2c938fa8 | [
"MulanPSL-1.0"
] | null | null | null | adoctor-diag-executor/adoctor_diag_executor/conf/default_config.py | seandong37tt4qu/jeszhengq | 32b3737ab45e89e8c5b71cdce871cefd2c938fa8 | [
"MulanPSL-1.0"
] | null | null | null | adoctor-diag-executor/adoctor_diag_executor/conf/default_config.py | seandong37tt4qu/jeszhengq | 32b3737ab45e89e8c5b71cdce871cefd2c938fa8 | [
"MulanPSL-1.0"
] | null | null | null | #!/usr/bin/python3
# ******************************************************************************
# Copyright (c) Huawei Technologies Co., Ltd. 2021-2021. All rights reserved.
# licensed under the Mulan PSL v2.
# You can use this software according to the terms and conditions of the Mulan PSL v2.
# You may obtain a c... | 34.833333 | 98 | 0.598086 | #!/usr/bin/python3
# ******************************************************************************
# Copyright (c) Huawei Technologies Co., Ltd. 2021-2021. All rights reserved.
# licensed under the Mulan PSL v2.
# You can use this software according to the terms and conditions of the Mulan PSL v2.
# You may obtain a c... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b38044726cf6222a81fb8be82779634ab86f045a | 16,668 | py | Python | layer_list_to_k210_layer.py | DIT4FUN/kendryte-model-compiler | 92f7baf48b16a77007c53f4e1623c1f9ba1e7de8 | [
"Apache-2.0"
] | 7 | 2019-11-25T10:41:21.000Z | 2021-03-18T14:16:19.000Z | layer_list_to_k210_layer.py | DIT4FUN/kendryte-model-compiler | 92f7baf48b16a77007c53f4e1623c1f9ba1e7de8 | [
"Apache-2.0"
] | null | null | null | layer_list_to_k210_layer.py | DIT4FUN/kendryte-model-compiler | 92f7baf48b16a77007c53f4e1623c1f9ba1e7de8 | [
"Apache-2.0"
] | 6 | 2019-07-19T09:10:34.000Z | 2020-12-08T05:08:34.000Z | '''
* Copyright 2018 Canaan Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... | 35.388535 | 132 | 0.609131 | '''
* Copyright 2018 Canaan Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... | 0 | 3,315 | 0 | 9,760 | 0 | 2,690 | 0 | -2 | 298 |
98f8043c08ab21c59bae75db421cfb8e3785fc3c | 3,560 | py | Python | Tools/cpu_usage.py | reginaldojunior/XU3EM | ddabdd4b3985fca57c01d94883ef875bbe4d95b4 | [
"BSD-3-Clause"
] | null | null | null | Tools/cpu_usage.py | reginaldojunior/XU3EM | ddabdd4b3985fca57c01d94883ef875bbe4d95b4 | [
"BSD-3-Clause"
] | null | null | null | Tools/cpu_usage.py | reginaldojunior/XU3EM | ddabdd4b3985fca57c01d94883ef875bbe4d95b4 | [
"BSD-3-Clause"
] | null | null | null | #! /usr/bin/env python3
#PATH = os.environ['HOME'] + '/Dropbox/big.Little_optimal_frequencies/data/'
main()
| 19.347826 | 130 | 0.650281 | #! /usr/bin/env python3
import sys
from time import sleep
import csv
import numpy as np
import subprocess
from pprint import pprint
#PATH = os.environ['HOME'] + '/Dropbox/big.Little_optimal_frequencies/data/'
def get_process_pid(name):
pgrep=subprocess.Popen(["pgrep", name],stdout=subprocess.PIPE)
pid = pgrep.c... | 0 | 0 | 0 | 0 | 0 | 3,149 | 0 | -24 | 319 |
60175e688082d22f596864bd12e29a7971a2f8de | 3,318 | py | Python | traits/traits.py | 0x022b/flexget-plugin-traits | c0721a8217fce880493c376392cca99166e80f53 | [
"MIT"
] | null | null | null | traits/traits.py | 0x022b/flexget-plugin-traits | c0721a8217fce880493c376392cca99166e80f53 | [
"MIT"
] | null | null | null | traits/traits.py | 0x022b/flexget-plugin-traits | c0721a8217fce880493c376392cca99166e80f53 | [
"MIT"
] | null | null | null | from loguru import logger
logger = logger.bind(name="traits")
| 33.18 | 87 | 0.520193 | from flexget import plugin
from flexget.event import event
from flexget.utils import qualities
from flexget.utils.qualities import QualityComponent
from loguru import logger
from typing import List
logger = logger.bind(name="traits")
class Traits:
"""
Override FlexGet's built-in quality requirement types wi... | 0 | 121 | 0 | 2,913 | 0 | 0 | 0 | 62 | 156 |
7590d0dd804f145e73ede5b015aa57fcb2400c8e | 3,903 | py | Python | scripts/distort.py | UMich-BipedLab/SegmentationMapping | b58eec234ae6fd78a2e7ba8b2398ff05fb467e19 | [
"MIT"
] | 36 | 2019-06-23T20:47:25.000Z | 2022-03-22T02:49:56.000Z | scripts/distort.py | crankler/SegmentationMapping | f4f95fa848ff59e322488d5b17e6ea1bdd15831c | [
"MIT"
] | 3 | 2020-06-07T09:22:04.000Z | 2021-08-02T19:01:12.000Z | scripts/distort.py | crankler/SegmentationMapping | f4f95fa848ff59e322488d5b17e6ea1bdd15831c | [
"MIT"
] | 13 | 2019-06-23T20:50:52.000Z | 2022-02-18T10:59:12.000Z | """
Demonstrating how to undistort images.
Reads in the given calibration file, parses it, and uses it to undistort the given
image. Then display both the original and undistorted images.
To use:
python undistort.py image calibration_file
"""
if __name__ == "__main__":
main()
| 34.539823 | 89 | 0.555983 | """
Demonstrating how to undistort images.
Reads in the given calibration file, parses it, and uses it to undistort the given
image. Then display both the original and undistorted images.
To use:
python undistort.py image calibration_file
"""
import numpy as np
import cv2
import matplotlib.pyplot as plt
import ... | 0 | 0 | 0 | 2,877 | 0 | 545 | 0 | 11 | 179 |
ee15789e7c67f8683d14f230cee2134d629e6610 | 401 | py | Python | test/test.py | pandocker/pandoc-docx-utils | b216d0b67db40c2394cf629c42eb4861481af151 | [
"MIT"
] | 3 | 2019-05-31T03:13:08.000Z | 2020-12-02T15:53:10.000Z | test/test.py | pandocker/pandoc-docx-utils | b216d0b67db40c2394cf629c42eb4861481af151 | [
"MIT"
] | null | null | null | test/test.py | pandocker/pandoc-docx-utils | b216d0b67db40c2394cf629c42eb4861481af151 | [
"MIT"
] | 2 | 2018-11-30T04:02:46.000Z | 2019-06-01T06:52:58.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
if __name__ == "__main__":
main()
| 22.277778 | 53 | 0.630923 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from pandoc_docx_utils import ExtractBulletList
import panflute as pf
def main():
with open("markdown.md", "r") as f:
md = f.read()
doc = pf.Doc(*pf.convert_text(md), format="docx")
pf.debug("doc: {}".format(*doc.content))
ebl = ExtractBulletList(... | 0 | 0 | 0 | 0 | 0 | 220 | 0 | 26 | 67 |
75bdb68a67244f21513a47f038c784df0158e119 | 1,948 | py | Python | analyse_repos.py | Lyken17/Deep-Learning-Framework-Popularity | 78eb8ac874f4f062da9e559b6b1c5ff755216416 | [
"MIT"
] | 1 | 2018-12-07T03:04:15.000Z | 2018-12-07T03:04:15.000Z | analyse_repos.py | Lyken17/Deep-Learning-Framework-Popularity | 78eb8ac874f4f062da9e559b6b1c5ff755216416 | [
"MIT"
] | null | null | null | analyse_repos.py | Lyken17/Deep-Learning-Framework-Popularity | 78eb8ac874f4f062da9e559b6b1c5ff755216416 | [
"MIT"
] | null | null | null | import os
import os.path as osp
from pprint import pprint
# import git
# from git import Repo
frameworks = (
"torch",
"tensorflow",
"mxnet",
"theano",
"keras",
"matlab",
"torch_c"
)
root = "test"
proj = "3D-ResNets-PyTorch"
for (dirpath, dirnames, filenames) in os.walk(root):
brea... | 23.190476 | 74 | 0.555955 | import os, sys
import os.path as osp
import subprocess
import shutil
from pprint import pprint
# import git
# from git import Repo
frameworks = (
"torch",
"tensorflow",
"mxnet",
"theano",
"keras",
"matlab",
"torch_c"
)
def find_keywords(path, word_bag):
with open(path, "r") as fp:
... | 0 | 0 | 0 | 0 | 0 | 1,152 | 0 | -7 | 90 |
6743ee20651bfb8f9873560c756a32be11f748fc | 10,980 | py | Python | syncli/api/transport.py | comodit/synapse-client | 9bc7fcc09367bc1f6ac7baff6f38fde9cbcdbf39 | [
"MIT"
] | 2 | 2016-06-23T05:57:37.000Z | 2021-02-02T06:47:35.000Z | syncli/api/transport.py | comodit/synapse-client | 9bc7fcc09367bc1f6ac7baff6f38fde9cbcdbf39 | [
"MIT"
] | null | null | null | syncli/api/transport.py | comodit/synapse-client | 9bc7fcc09367bc1f6ac7baff6f38fde9cbcdbf39 | [
"MIT"
] | 2 | 2017-09-23T00:05:51.000Z | 2019-05-13T15:43:48.000Z | import pika
# As mentioned in pika's PlainCredentials class, we need to append the new
# authentication mechanism to VALID_TYPES
pika.credentials.VALID_TYPES.append(ExternalCredentials)
| 37.346939 | 79 | 0.557013 | import threading
import pika
import time
import json
import sys
from pprint import pformat
from Queue import Empty
from ssl import CERT_REQUIRED
from pika import PlainCredentials
from pika import SelectConnection
from pika.adapters.select_connection import SelectPoller
from syncli.config import config
from syncli.lo... | 0 | 9,352 | 0 | 1,042 | 0 | 0 | 0 | 60 | 336 |
82d2443ff75e7c8cbbf491b166727e68af5e38b5 | 903 | py | Python | peeringdb/migrations/0015_auto_20210227_1258.py | ggidofalvy-tc/peering-manager | 0c358b108494f51936264f3ec5d600c20827a745 | [
"Apache-2.0"
] | 173 | 2020-08-08T15:38:08.000Z | 2022-03-21T11:35:25.000Z | peeringdb/migrations/0015_auto_20210227_1258.py | ggidofalvy-tc/peering-manager | 0c358b108494f51936264f3ec5d600c20827a745 | [
"Apache-2.0"
] | 192 | 2020-08-08T22:03:45.000Z | 2022-03-31T04:20:44.000Z | peeringdb/migrations/0015_auto_20210227_1258.py | ggidofalvy-tc/peering-manager | 0c358b108494f51936264f3ec5d600c20827a745 | [
"Apache-2.0"
] | 33 | 2020-08-14T21:24:38.000Z | 2022-03-06T14:55:13.000Z | # Generated by Django 3.1.6 on 2021-02-27 11:58
| 26.558824 | 63 | 0.565891 | # Generated by Django 3.1.6 on 2021-02-27 11:58
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("peeringdb", "0014_auto_20201208_1856"),
]
operations = [
migrations.AddField(
model_name="facility",
name="floor",
... | 0 | 0 | 0 | 789 | 0 | 0 | 0 | 19 | 46 |
eee3f4823fac8c98d8e4272e945ab73d32f76775 | 610 | py | Python | weboobToFile/helpers/serializer.py | QuentinBay/weboobToFile | a42d6a36f74dbc5d865c4e668f2d0bdc2ab9feea | [
"BSD-2-Clause"
] | null | null | null | weboobToFile/helpers/serializer.py | QuentinBay/weboobToFile | a42d6a36f74dbc5d865c4e668f2d0bdc2ab9feea | [
"BSD-2-Clause"
] | null | null | null | weboobToFile/helpers/serializer.py | QuentinBay/weboobToFile | a42d6a36f74dbc5d865c4e668f2d0bdc2ab9feea | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
| 24.4 | 71 | 0.721311 | # -*- coding: utf-8 -*-
import json
import time
import os
from pretty import get_pretty_json
import webbrowser
def create_fileName():
name = str(time.strftime("%d-%m-%YT%H:%M:%S"))+"_comptes_jean-mi.json"
return name
# print sum(len(v) for v in content.itervalues())
def write_content(filePath, content):
content ... | 0 | 0 | 0 | 0 | 0 | 428 | 0 | -23 | 180 |
547a5c13b9de2907191cc65b5d2a1c9d17506d12 | 211 | py | Python | utilities/mytests/xxx.py | Saldenisov/pyconlyse | 1de301b4a4c15ee0bd19034aa8d5da1beacfd124 | [
"MIT"
] | null | null | null | utilities/mytests/xxx.py | Saldenisov/pyconlyse | 1de301b4a4c15ee0bd19034aa8d5da1beacfd124 | [
"MIT"
] | null | null | null | utilities/mytests/xxx.py | Saldenisov/pyconlyse | 1de301b4a4c15ee0bd19034aa8d5da1beacfd124 | [
"MIT"
] | null | null | null |
from datetime import datetime
# current date and time
now = datetime.now()
timestamp = datetime.timestamp(now)
print(type(timestamp))
print("timestamp =", timestamp)
print(datetime.fromtimestamp(timestamp)) | 17.583333 | 40 | 0.772512 |
from datetime import datetime
# current date and time
now = datetime.now()
timestamp = datetime.timestamp(now)
print(type(timestamp))
print("timestamp =", timestamp)
print(datetime.fromtimestamp(timestamp)) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8a4c267bf18f555847f045e803a8d04ae847b40d | 2,001 | py | Python | py/25. Reverse Nodes in k-Group.py | longwangjhu/LeetCode | a5c33e8d67e67aedcd439953d96ac7f443e2817b | [
"MIT"
] | 3 | 2021-08-07T07:01:34.000Z | 2021-08-07T07:03:02.000Z | py/25. Reverse Nodes in k-Group.py | longwangjhu/LeetCode | a5c33e8d67e67aedcd439953d96ac7f443e2817b | [
"MIT"
] | null | null | null | py/25. Reverse Nodes in k-Group.py | longwangjhu/LeetCode | a5c33e8d67e67aedcd439953d96ac7f443e2817b | [
"MIT"
] | null | null | null | # https://leetcode.com/problems/reverse-nodes-in-k-group/
# Given a linked list, reverse the nodes of a linked list k at a time and return
# its modified list.
# k is a positive integer and is less than or equal to the length of the linked
# list. If the number of nodes is not a multiple of k then left-out nodes, in ... | 32.274194 | 81 | 0.524238 | # https://leetcode.com/problems/reverse-nodes-in-k-group/
# Given a linked list, reverse the nodes of a linked list k at a time and return
# its modified list.
# k is a positive integer and is less than or equal to the length of the linked
# list. If the number of nodes is not a multiple of k then left-out nodes, in ... | 0 | 0 | 0 | 1,085 | 0 | 0 | 0 | 0 | 23 |
52ef01aa59580edd9b3cededa08205c3cd7472d3 | 2,090 | py | Python | app.py | naomisdev/sqlalchemy-challenge | 7e22d57a053828e4d3eab3b99b09f3e6f7fc06c3 | [
"ADSL"
] | null | null | null | app.py | naomisdev/sqlalchemy-challenge | 7e22d57a053828e4d3eab3b99b09f3e6f7fc06c3 | [
"ADSL"
] | null | null | null | app.py | naomisdev/sqlalchemy-challenge | 7e22d57a053828e4d3eab3b99b09f3e6f7fc06c3 | [
"ADSL"
] | null | null | null | # 1. Import Flask
from flask import Flask
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import Session
from sqlalchemy import create_engine
engine = create_engine("sqlite:///Resources/hawaii.sqlite")
Base = automap_base()
Base.prepare(engine,reflect=True)
measurement = Base.classes.measurement
st... | 28.630137 | 174 | 0.702871 | # 1. Import Flask
from flask import Flask,jsonify
import sqlalchemy
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import Session
from sqlalchemy import create_engine, func
import datetime as dt
engine = create_engine("sqlite:///Resources/hawaii.sqlite")
Base = automap_base()
Base.prepare(engine,r... | 0 | 1,442 | 0 | 0 | 0 | 0 | 0 | 10 | 159 |
917903674eca4ea23b0aa379b9063c2048d520b8 | 2,305 | py | Python | test/munge_test.py | NERSC/nersc_sdn | ea6c6486d2390a06b31411397e71e53e5aa8a82b | [
"BSD-3-Clause-LBNL"
] | null | null | null | test/munge_test.py | NERSC/nersc_sdn | ea6c6486d2390a06b31411397e71e53e5aa8a82b | [
"BSD-3-Clause-LBNL"
] | null | null | null | test/munge_test.py | NERSC/nersc_sdn | ea6c6486d2390a06b31411397e71e53e5aa8a82b | [
"BSD-3-Clause-LBNL"
] | null | null | null | # Shifter, Copyright (c) 2015, The Regents of the University of California,
# through Lawrence Berkeley National Laboratory (subject to receipt of any
# required approvals from the U.S. Dept. of Energy). All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are per... | 39.741379 | 79 | 0.68243 | # Shifter, Copyright (c) 2015, The Regents of the University of California,
# through Lawrence Berkeley National Laboratory (subject to receipt of any
# required approvals from the U.S. Dept. of Energy). All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are per... | 0 | 0 | 0 | 1,180 | 0 | 0 | 0 | -12 | 90 |
8cb7c38a9d2619bce88093a903ad720eb75d9882 | 649 | py | Python | api/config.py | verhovyh/Currency_Service | c230fca0f554741d8e3519dbe1185a7219dbf500 | [
"MIT"
] | null | null | null | api/config.py | verhovyh/Currency_Service | c230fca0f554741d8e3519dbe1185a7219dbf500 | [
"MIT"
] | null | null | null | api/config.py | verhovyh/Currency_Service | c230fca0f554741d8e3519dbe1185a7219dbf500 | [
"MIT"
] | null | null | null |
config = {"dev": DevelopmentConfig, "prod": ProductionConfig, "docker": DockerDevConfig}
| 24.037037 | 88 | 0.731895 | import os
class Config:
SECRET_KEY = "testkey"
SQLALCHEMY_TRACK_MODIFICATIONS = False
LOG_FILE = "api.log"
class DevelopmentConfig(Config):
SQLALCHEMY_DATABASE_URI = "postgresql://testusr:password@127.0.0.1:5432/testdb"
# SQLALCHEMY_DATABASE_URI = 'postgres://127.0.0.1:5432'
DEBUG = True
c... | 0 | 0 | 0 | 452 | 0 | 0 | 0 | -12 | 114 |
1bc316180274b78acdb656dd9624620fb5802c42 | 3,607 | py | Python | K_ARM_Opt.py | PurduePAML/K-ARM_Backdoor_Optimization | 8c837fd386f64f0cb2a1021e2d94a327339187ff | [
"MIT"
] | 10 | 2021-06-22T23:05:01.000Z | 2022-02-21T21:23:31.000Z | K_ARM_Opt.py | PurduePAML/K-ARM_Backdoor_Optimization | 8c837fd386f64f0cb2a1021e2d94a327339187ff | [
"MIT"
] | null | null | null | K_ARM_Opt.py | PurduePAML/K-ARM_Backdoor_Optimization | 8c837fd386f64f0cb2a1021e2d94a327339187ff | [
"MIT"
] | 2 | 2022-01-20T20:07:11.000Z | 2022-02-03T20:54:57.000Z | # K-Arm Optimization
########################################################################################################################################
### K_Arm_Opt functions load data based on different trigger types, then create an instance of K-Arm scanner and run optimization ###
### It returns the target... | 34.682692 | 154 | 0.64153 | # K-Arm Optimization
########################################################################################################################################
### K_Arm_Opt functions load data based on different trigger types, then create an instance of K-Arm scanner and run optimization ###
### It returns the target... | 0 | 0 | 0 | 0 | 0 | 2,806 | 0 | 47 | 179 |
d431024a0475707fdc2ac858d62b93c6d4b74b96 | 8,799 | py | Python | crypto/bytectf-2020/APAKE/server.py | BadMonkey7/funny-ctf-challenge | 827caed5ab54f1da9217dfa25b034b9b398b11ef | [
"MIT"
] | 2 | 2020-10-22T08:13:52.000Z | 2021-01-16T06:56:24.000Z | crypto/bytectf-2020/APAKE/server.py | BadMonkey7/funny-ctf-challenge | 827caed5ab54f1da9217dfa25b034b9b398b11ef | [
"MIT"
] | null | null | null | crypto/bytectf-2020/APAKE/server.py | BadMonkey7/funny-ctf-challenge | 827caed5ab54f1da9217dfa25b034b9b398b11ef | [
"MIT"
] | null | null | null | from gmssl import sm3, func
from binascii import b2a_hex
sm2p256v1_ecc_table = {
'n': 'FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123',
'p': 'FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFF',
'g': '32c4ae2c1f1981195f9904466a39c9948fe30bbff2660be1715a4589334c74c7' +
... | 41.116822 | 116 | 0.524378 | from gmssl import sm3, func
from binascii import a2b_hex, b2a_hex
sm2p256v1_ecc_table = {
'n': 'FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123',
'p': 'FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFF',
'g': '32c4ae2c1f1981195f9904466a39c9948fe30bbff2660be1715a4589334c74c7'... | 0 | 0 | 0 | 7,486 | 0 | 0 | 0 | 9 | 23 |
433341581ddc8c2f0a17eff7e795dc589b084ac1 | 96 | py | Python | 20160522.py | JaeGyu/PythonEx_1 | e67053db6ca7431c3dd66351c190c53229e3f141 | [
"MIT"
] | null | null | null | 20160522.py | JaeGyu/PythonEx_1 | e67053db6ca7431c3dd66351c190c53229e3f141 | [
"MIT"
] | null | null | null | 20160522.py | JaeGyu/PythonEx_1 | e67053db6ca7431c3dd66351c190c53229e3f141 | [
"MIT"
] | null | null | null | #_*_ coding: utf-8 _*_
my_func(input(" : ")) | 16 | 30 | 0.645833 | #_*_ coding: utf-8 _*_
def my_func(name):
print("hello", name)
my_func(input("이름을 입력하세요 : ")) | 24 | 0 | 0 | 0 | 0 | 19 | 0 | 0 | 23 |
1ee928f69310d2d25524fd5ca0fbe92f9867e624 | 1,876 | py | Python | vulnerabilities/tests/test_debian.py | ziadhany/vulnerablecode | c94ed5701a70bc836a66484f6d54aacc81c4288f | [
"Apache-2.0"
] | null | null | null | vulnerabilities/tests/test_debian.py | ziadhany/vulnerablecode | c94ed5701a70bc836a66484f6d54aacc81c4288f | [
"Apache-2.0"
] | null | null | null | vulnerabilities/tests/test_debian.py | ziadhany/vulnerablecode | c94ed5701a70bc836a66484f6d54aacc81c4288f | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) nexB Inc. and others. All rights reserved.
# VulnerableCode is a trademark of nexB Inc.
# SPDX-License-Identifier: Apache-2.0
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
# See https://github.com/nexB/vulnerablecode for support or download.
# See https://aboutcode.org for mor... | 40.782609 | 80 | 0.764392 | #
# Copyright (c) nexB Inc. and others. All rights reserved.
# VulnerableCode is a trademark of nexB Inc.
# SPDX-License-Identifier: Apache-2.0
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
# See https://github.com/nexB/vulnerablecode for support or download.
# See https://aboutcode.org for mor... | 0 | 1,076 | 0 | 0 | 0 | 0 | 0 | 144 | 180 |
e29b9aab4105fbe1f2c1f91e623886072ccc6154 | 1,121 | py | Python | src/OCR-Mike/pyimagesearch/montaje.py | EquipoIA/image-recon | f53cef4073b49fc20be44d2555eb2e88c5154b2e | [
"MIT"
] | null | null | null | src/OCR-Mike/pyimagesearch/montaje.py | EquipoIA/image-recon | f53cef4073b49fc20be44d2555eb2e88c5154b2e | [
"MIT"
] | null | null | null | src/OCR-Mike/pyimagesearch/montaje.py | EquipoIA/image-recon | f53cef4073b49fc20be44d2555eb2e88c5154b2e | [
"MIT"
] | null | null | null | from tensorflow.keras.models import load_model
import numpy as np
import cv2
model = load_model('handwriting.model')
#imprimir una imagen con muestra
images = []
# seleccionar muestras aleatorias de los datos
for i in np.random.choice(np.arange(0, len(testY)), size=(64,)):
# hacer las predicciones
probs = model.pre... | 29.5 | 68 | 0.720785 | from tensorflow.keras.models import load_model
import numpy as np
import cv2
model = load_model('handwriting.model')
#imprimir una imagen con muestra
images = []
# seleccionar muestras aleatorias de los datos
for i in np.random.choice(np.arange(0, len(testY)), size=(64,)):
# hacer las predicciones
probs = model.pre... | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2b9a84747049cf7e632cbca8dcdc0e46f493b2c3 | 146 | py | Python | hitcount/apps.py | LinuxOSsk/Shakal-NG | c4091c7972cffd86f64aa9f9a058d2907a56e5eb | [
"MIT"
] | 10 | 2016-02-06T15:40:30.000Z | 2018-09-27T15:15:13.000Z | hitcount/apps.py | LinuxOSsk/Shakal-NG | c4091c7972cffd86f64aa9f9a058d2907a56e5eb | [
"MIT"
] | 94 | 2016-02-04T18:39:36.000Z | 2022-01-20T05:25:00.000Z | hitcount/apps.py | LinuxOSsk/Shakal-NG | c4091c7972cffd86f64aa9f9a058d2907a56e5eb | [
"MIT"
] | 8 | 2016-05-10T20:29:53.000Z | 2021-02-07T00:50:31.000Z | # -*- coding: utf-8 -*-
| 18.25 | 33 | 0.719178 | # -*- coding: utf-8 -*-
from django.apps import AppConfig
class HitcountConfig(AppConfig):
name = 'hitcount'
verbose_name = 'Počty zobrazení'
| 4 | 0 | 0 | 62 | 0 | 0 | 0 | 12 | 45 |
8f28215522084e13c809b25e51ca43dd0fa2dff0 | 2,431 | py | Python | accounts/accounts/config.py | SamanthaFeidFischer/arxiv-auth | 08df4e0196a04a06eac1d26477b3ad56ebf56f08 | [
"MIT"
] | 1 | 2018-12-11T05:02:22.000Z | 2018-12-11T05:02:22.000Z | accounts/accounts/config.py | SamanthaFeidFischer/arxiv-auth | 08df4e0196a04a06eac1d26477b3ad56ebf56f08 | [
"MIT"
] | 14 | 2019-06-20T13:36:13.000Z | 2021-06-25T15:19:59.000Z | accounts/accounts/config.py | SamanthaFeidFischer/arxiv-auth | 08df4e0196a04a06eac1d26477b3ad56ebf56f08 | [
"MIT"
] | null | null | null | """Flask configuration."""
import os
VERSION = '0.2'
SECRET_KEY = os.environ.get('SECRET_KEY', 'asdf1234')
SERVER_NAME = os.environ.get('ACCOUNTS_SERVER_NAME')
AWS_ACCESS_KEY_ID = os.environ.get('AWS_ACCESS_KEY_ID', 'nope')
AWS_SECRET_ACCESS_KEY = os.environ.get('AWS_SECRET_ACCESS_KEY', 'nope')
AWS_REGION = os.envi... | 32.851351 | 89 | 0.749486 | """Flask configuration."""
import os
VERSION = '0.2'
SECRET_KEY = os.environ.get('SECRET_KEY', 'asdf1234')
SERVER_NAME = os.environ.get('ACCOUNTS_SERVER_NAME')
AWS_ACCESS_KEY_ID = os.environ.get('AWS_ACCESS_KEY_ID', 'nope')
AWS_SECRET_ACCESS_KEY = os.environ.get('AWS_SECRET_ACCESS_KEY', 'nope')
AWS_REGION = os.envi... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
276504bff429f2abac16714640bce809be05f380 | 2,437 | py | Python | transcriptor/job.py | kjaymiller/transcriptor | fc2a4cbf82dce4bb79f828f8f2ed3599861971ee | [
"MIT"
] | 13 | 2019-02-28T00:36:38.000Z | 2020-12-13T02:40:54.000Z | transcriptor/job.py | kjaymiller/transcriptor | fc2a4cbf82dce4bb79f828f8f2ed3599861971ee | [
"MIT"
] | 10 | 2020-08-04T03:23:27.000Z | 2020-10-09T18:10:25.000Z | transcriptor/job.py | kjaymiller/transcriptor | fc2a4cbf82dce4bb79f828f8f2ed3599861971ee | [
"MIT"
] | 2 | 2020-05-09T04:56:50.000Z | 2020-09-18T22:16:50.000Z | from .speakers import Speaker
| 27.077778 | 148 | 0.597046 | from .alternatives import Alternative
from .tools import (
str_to_timedelta,
timedelta_from_str,
)
from .helpers import text_in_range
from .speakers import Speaker
from .markers import Marker
from .segments import Segment
from .speakers import Speaker
from pathlib import Path
from datetime import timedelta
imp... | 0 | 0 | 0 | 2,041 | 0 | 0 | 0 | 77 | 288 |
04c5bff6fcdd71fc56c4afa22a50e782eb405b01 | 2,399 | py | Python | io/swig/io/run.py | ljktest/siconos | 85b60e62beca46e6bf06bfbd65670089e86607c7 | [
"Apache-2.0"
] | 137 | 2015-06-16T15:55:28.000Z | 2022-03-26T06:01:59.000Z | io/swig/io/run.py | ljktest/siconos | 85b60e62beca46e6bf06bfbd65670089e86607c7 | [
"Apache-2.0"
] | 381 | 2015-09-22T15:31:08.000Z | 2022-02-14T09:05:23.000Z | io/swig/io/run.py | ljktest/siconos | 85b60e62beca46e6bf06bfbd65670089e86607c7 | [
"Apache-2.0"
] | 30 | 2015-08-06T22:57:51.000Z | 2022-03-02T20:30:20.000Z | #!/usr/bin/env @PYTHON_EXECUTABLE@
"""
Description: Run a pre-generated Siconos mechanics-IO HDF5 simulation file.
"""
# Lighter imports before command line parsing
from __future__ import print_function
import argparse
parser = argparse.ArgumentParser(
description = __doc__,
epilog = """This script only provi... | 43.618182 | 83 | 0.684452 | #!/usr/bin/env @PYTHON_EXECUTABLE@
"""
Description: Run a pre-generated Siconos mechanics-IO HDF5 simulation file.
"""
# Lighter imports before command line parsing
from __future__ import print_function
import argparse
parser = argparse.ArgumentParser(
description = __doc__,
epilog = """This script only provi... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f4ad454c766f7bf6b052a7e0f5df6862dd752320 | 18,590 | py | Python | Final_Project/model.py | hansenbeast/2019-SYSU-DM | 39250fe21681ea445d38d521679fb4b9d6b0d345 | [
"MIT"
] | 2 | 2021-06-21T02:54:49.000Z | 2021-07-15T07:26:41.000Z | Final_Project/model.py | hansenbeast/2019-SYSU-DM | 39250fe21681ea445d38d521679fb4b9d6b0d345 | [
"MIT"
] | null | null | null | Final_Project/model.py | hansenbeast/2019-SYSU-DM | 39250fe21681ea445d38d521679fb4b9d6b0d345 | [
"MIT"
] | 1 | 2019-06-04T06:20:59.000Z | 2019-06-04T06:20:59.000Z | # Original Version: Taehoon Kim (http://carpedm20.github.io)
# + Source: https://github.com/carpedm20/DCGAN-tensorflow/blob/e30539fb5e20d5a0fed40935853da97e9e55eee8/model.py
# + License: MIT
from __future__ import division
| 40.857143 | 121 | 0.557181 | # Original Version: Taehoon Kim (http://carpedm20.github.io)
# + Source: https://github.com/carpedm20/DCGAN-tensorflow/blob/e30539fb5e20d5a0fed40935853da97e9e55eee8/model.py
# + License: MIT
from __future__ import division
import os
import time
from glob import glob
import tensorflow as tf
import pickle
from six.m... | 0 | 0 | 0 | 18,157 | 0 | 0 | 0 | -17 | 222 |