text
string
size
int64
token_count
int64
from django.db import models from django.db.models.deletion import CASCADE from django.contrib.auth.models import User from cloudinary.models import CloudinaryField # Create your models here. class Profile(models.Model): """Model for handling User Profile""" user = models.OneToOneField(User, on_delete= models....
3,843
1,113
from odoo import SUPERUSER_ID, api from odoo.tools.sql import column_exists def migrate(cr, version=None): env = api.Environment(cr, SUPERUSER_ID, {}) if column_exists(cr, "product_template", "purchase_request"): _migrate_purchase_request_to_property(env) def _migrate_purchase_request_to_property(en...
846
262
# coding=UTF-8 """Server stuff.""" from __future__ import print_function from cfy import (create_server, create_ssh_key, attach_ssh_key, wait_for_state, wait_for_cond, create_nic, attach_nic, get_res...
13,678
4,553
# coding: utf-8 """ markdown2dita ~~~~~~~~~~~~~ A markdown to dita-ot conversion tool written in pure python. Uses mistune to parse the markdown. """ from __future__ import print_function import argparse import sys import mistune __version__ = '0.3' __author__ = 'Matt Carabine <matt.carabine@gmail.c...
7,317
2,255
import pytest import os from helpers.cluster import ClickHouseCluster SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__)) cluster = ClickHouseCluster(__file__) node = cluster.add_instance('node', main_configs=["configs/first.crt", "configs/first.key", "configs/sec...
2,957
914
import flingclient as fc from flingclient.rest import ApiException from datetime import datetime # Per default the dockerized fling service runs on localhost:3000 In case you # run your own instance, change the base url configuration = fc.Configuration(host="http://localhost:3000") # Every call, with the exception of...
1,331
408
import tensorflow.compat.v1 as tf import os import tqdm GCS_BUCKET = 'gs://ptt5-1' TENSORBOARD_LOGS_LOCAL = '../logs_tensorboard' os.makedirs(TENSORBOARD_LOGS_LOCAL, exist_ok=True) # where to look for events files - experiment names base_paths = [ # Main initial experiments - all weights are updated 'small_s...
1,811
648
import base64 import requests class RemotePkcs1Signer(object): """ Client-side Signer subclass, that calls the Signing Service over HTTP to sign things """ # standard headers for request headers = { 'Content-Type': 'application/json', 'Accept': 'application/json' } def __init__(s...
1,408
407
import logging import re from celery import shared_task from django.conf import settings from django.db.models import Q from django.shortcuts import get_object_or_404 from django.template.loader import get_template from django.urls import reverse from django.utils import timezone from architecture_tool_django.utils.c...
4,497
1,460
from crosswalk.authentication import AuthenticatedView from crosswalk.models import Domain, Entity from crosswalk.serializers import EntitySerializer from crosswalk.utils import import_class from django.core.exceptions import ObjectDoesNotExist from rest_framework import status from rest_framework.response import Respo...
3,195
826
from fastapi import FastAPI, Response, WebSocket, WebSocketDisconnect from threading import Thread from .server import Server from .errors import HoistExistsError from .error import Error from .version import __version__ from .flask_wrapper import HTML import uvicorn from typing import List, Callable from fastapi.respo...
3,629
1,020
# This file is executed on every boot (including wake-boot from deepsleep) # 2017-1210 PePo send timestamp and temperature (Celsius) to MQTT-server on BBB # 2017-1105 PePo add _isLocal: sensor data to serial port (False) of stored in file (True) # 2017-0819 PePo add sensor, led and print to serial port # 2017-0811 ...
4,874
1,745
#!/usr/bin/python3 lines = open("inputs/07.in", "r").readlines() for i,line in enumerate(lines): lines[i] = line.split("\n")[0] l = lines.copy(); wires = {} def func_set(p, i): if p[0].isdigit(): wires[p[2]] = int(p[0]) lines.pop(i) elif p[0] in wires.keys(): wires[p[2]] = wires[p...
1,724
741
import socket import time import numpy # This script sends a message to the board, at IP address and port given by # server_address, using User Datagram Protocol (UDP). The board should be # programmed to echo back UDP packets sent to it. The time taken for num_samples # echoes is measured. # Create a UDP socket sock...
1,659
557
#!/usr/bin/env python # # This file is part of the Emotions project. The complete source code is # available at https://github.com/luigivieira/emotions. # # Copyright (c) 2016-2017, Luiz Carlos Vieira (http://www.luiz.vieira.nom.br) # # MIT License # # Permission is hereby granted, free of charge, to any person obtaini...
16,058
4,929
from . import Konform def main(): Konform().run()
56
20
""" Holds global celery application state and startup / shutdown handlers. """ from celery import Celery from celery.app import app_or_default from celery.signals import ( beat_init, worker_process_init, worker_process_shutdown, setup_logging, ) from ichnaea.log import configure_logging from ichnaea.ta...
1,711
551
import asyncio from typing import Tuple import heapq class BasePersistentStorage(object): async def push_message(self, mid, raw_package): raise NotImplementedError def push_message_nowait(self, mid, raw_package) -> asyncio.Future: try: asyncio.get_event_loop() except Runt...
1,771
546
# Copyright 2017 Lajos Gerecs, Janos Czentye # # 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...
10,638
3,351
from microbit import * hands = Image.ALL_CLOCKS #A centre dot of brightness 2. ticker_image = Image("2\n").crop(-2,-2,5,5) #Adjust these to taste MINUTE_BRIGHT = 0.1111 HOUR_BRIGHT = 0.55555 #Generate hands for 5 minute intervals def fiveticks(): fivemins = 0 hours = 0 while True: yield hands[f...
868
321
#Variables #Working with build 2234 saberPort = "/dev/ttyUSB0" #Initializing Motorcontroller saber = Runtime.start("saber", "Sabertooth") saber.connect(saberPort) sleep(1) #Initializing Joystick joystick = Runtime.start("joystick","Joystick") print(joystick.getControllers()) python.subscribe("joystick","publishJoysti...
528
227
# -*- coding: utf-8 -*- # This file is part of Weevely NG. # # Copyright(c) 2011-2012 Weevely Developers # http://code.google.com/p/weevely/ # # This file may be licensed under the terms of of the # GNU General Public License Version 2 (the ``GPL''). # # Software distributed under the License is distributed # on an ``A...
4,542
1,850
from musicscore.dtd.dtd import Sequence, GroupReference, Choice, Element from musicscore.musicxml.attributes.optional_unique_id import OptionalUniqueId from musicscore.musicxml.attributes.printobject import PrintObject from musicscore.musicxml.groups.common import Editorial from musicscore.musicxml.elements.xml_element...
4,638
1,458
from types import SimpleNamespace from src.utils.keyboard import create_keyboard keys = SimpleNamespace( settings=':gear: Settings', cancel=':cross_mark: Cancel', back=':arrow_left: Back', next=':arrow_right: Next', add=':heavy_plus_sign: Add', edit=':pencil: Edit', save=':check_mark_butt...
794
266
# Author: Guilherme Aldeia # Contact: guilherme.aldeia@ufabc.edu.br # Version: 1.0.0 # Last modified: 08-20-2021 by Guilherme Aldeia """ Simple exception that is raised by explainers when they don't support local or global explanations, or when they are not model agnostic. This should be catched and handled i...
456
155
import click from covid_data_tracker.registry import PluginRegistry def plugin_selector(selected_country: str): """plugin selector uses COUNTRY_MAP to find the appropriate plugin for a given country. Parameters ---------- selected_country : str specify the country of interest. Ret...
1,302
348
import selenium from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.common.exceptions import TimeoutException def browser_init(): option = webdriver.Chro...
1,416
459
from setuptools import setup setup(name='osmuf', version='0.1', install_requires=[ "seaborn", ], description='Urban Form analysis from OpenStreetMap', url='http://github.com/atelierlibre/osmuf', author='AtelierLibre', author_email='mail@atelierlibre.org', lic...
380
126
# -*- coding: utf-8 -*- """ tests.test_model ~~~~~~~~~~~~~~~~ Tests the models provided by the updown rating app :copyright: 2016, weluse (https://weluse.de) :author: 2016, Daniel Banck <dbanck@weluse.de> :license: BSD, see LICENSE for more details. """ from __future__ import unicode_literals import random from djan...
1,813
633
import sys,os from typing import List from collections import defaultdict, Counter from itertools import groupby, chain, product import heapq from pprint import pprint import string class Rake(): def __init__( self, text:List[List[str]], stopwords=[], max_words=100...
5,179
1,507
import numpy as np import openturns as ot def func_overflow(X, model=1, h_power=0.6): """Overflow model function. Parameters ---------- X : np.ndarray, shape : N x 8 Input variables - x1 : Flow, - x2 : Krisler Coefficient, - x3 : Zv, etc... model : bool, option...
5,623
2,216
from flask_wtf import FlaskForm from wtforms import StringField,TextAreaField,SubmitField from wtforms.validators import Required class ReviewForm(FlaskForm): title = StringField('Review title',validators=[Required()]) review = TextAreaField('Movie review', validators=[Required()]) submit = SubmitField('...
1,699
478
from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware from starlette import status from starlette.middleware.base import BaseHTTPMiddleware, RequestResponseEndpoint from starlette.requests import Request from starlette.responses import Response from starlette.types import ASGIApp from config ...
3,228
1,175
"""Semi continuous unit operations. Unit operations that accept constant or box-shaped flow rate profile and provide periodic flow rate profile. """ __all__ = ['AlternatingChromatography', 'ACC', 'PCC', 'PCCWithWashDesorption'] __version__ = '0.7.1' __author__ = 'Jure Sencar' import typing as _typing import numpy as...
94,831
28,840
import matplotlib.pyplot as plt def main(): with open('log.txt') as f: lines = f.readlines() glob_loss = [] hm_l = [] off_l = [] poly_l = [] depth_l = [] glob_loss_val = [] hm_l_val = [] off_l_val = [] poly_l_val = [] depth_l_val = [] for epoch in lines: m = epoch.split("|") if ...
1,640
750
#!/usr/bin/python3 import json from aioflureedb.signing import DbSigner def free_test(signer): data = {"foo": 42, "bar": "appelvlaai"} body, headers, uri = signer.sign_query(data) rval = dict() rval["body"] = body rval["headers"] = headers rval["uri"] = uri rval = json.dumps(rval, indent=4,...
551
268
# Copyright 2016 Brocade Communications Systems, 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 ...
3,447
913
#!/usr/bin/env python3 ### # Based on signature.R ### import sys,os,logging import numpy as np import pandas as pd if __name__=="__main__": logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.DEBUG) if (len(sys.argv) < 3): logging.error("3 file args required, LINCS sig info for GSE70138 and...
1,182
520
# ASSIGNMENT 3 """ During a programming contest, each contestant had to solve 3 problems (named P1, P2 and P3). Afterwards, an evaluation committee graded the solutions to each of the problems using integers between 0 and 10. The committee needs a program that will allow managing the list of scores and esta...
8,289
2,838
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Examples for the NURBS-Python Package Released under MIT License Developed by Onur Rauf Bingol (c) 2016-2017 """ import os from geomdl import BSpline from geomdl import utilities from geomdl import exchange from geomdl import operations from geomdl.visuali...
1,212
455
#=============================================================================== # Copyright 2020-2021 Intel Corporation # # 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.apa...
1,380
462
## Generated by pyxsdgen from xml.etree import ElementTree as ET # types class OrderedStpType(object): def __init__(self, order, stp): self.order = order # int self.stp = stp # StpIdType -> string @classmethod def build(self, element): return OrderedStpType( ele...
3,580
1,131
import matplotlib.pyplot as plt import numpy as np x=20 y=1 plt.plot(x,y) plt.show()
87
41
import os import sys import argparse import copy import numpy as np import scipy.special sys.path.append(os.getcwd()) def log_gaussian_pdf(theta, sigma=1, mu=0, ndim=None): if ndim is None: try: ndim = len(theta) except TypeError: assert isinstance(theta, (float, int)), t...
3,708
1,325
__all__ = ['Message'] import uuid from email.header import decode_header as _decode_header from email.message import Message as EmailMessage from email.utils import getaddresses from typing import Union, List, Dict, Any class Message: __slots__ = ( 'id', 'sender_envelope', 'sender_message', ...
3,060
978
from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC import unittest class NewVisitorTest(unittest.TestCase): def setUp(self): self.timeout = 40 self.browser = webdriv...
1,705
688
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a cop...
30,017
9,911
__all__ = [ "assistant", "event", "error" ]
43
17
guests=int(input()) reservations=set([]) while guests!=0: reservationCode=input() reservations.add(reservationCode) guests-=1 while True: r=input() if r!="END": reservations.discard(r) else: print(len(reservations)) VIPS=[]; Regulars=[] for e in reservations: ...
577
190
# Create a plotter and remove all lights after initialization. # Note how the mesh rendered is completely flat # import pyvista as pv plotter = pv.Plotter() plotter.remove_all_lights() plotter.renderer.lights # Expected: ## [] _ = plotter.add_mesh(pv.Sphere(), show_edges=True) plotter.show() # # Note how this differs f...
404
141
from typing import Dict, Tuple import numpy as np def einsum(expr: str, *args: Tuple[np.ndarray, ...], **kwargs) -> np.ndarray: (a, b) = map(str.strip, expr.split("->")) a_ = list( map(lambda s: list(map(str.strip, s.split(","))), map(str.strip, a.split(";"))) ) b_ = list(map(str.strip, b.spli...
880
339
import json import logging import os import pickle import sys import time import pyzmail # http://mypy.pythonblogs.com/12_mypy/archive/1253_workaround_for_python_bug_ascii_codec_cant_encode_character_uxa0_in_position_111_ordinal_not_in_range128.html reload(sys) sys.setdefaultencoding("utf8") logging.basicConfig(form...
4,201
1,296
class Solution: def anagramMappings(self, A: List[int], B: List[int]) -> List[int]:
97
34
# # ---------------------------------------------------------------------------------------------------- # # Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify ...
1,547
478
import pandas as pd import numpy as np import matplotlib.pyplot as plt from scipy.stats import multivariate_normal class _LinearModel(object): def __init__(self): self.w = None def fit(self, x, y): pass def predict(self, x): return np.dot(x, self.w) def cost(self, x...
4,621
1,760
from .lexer import SolidityLexer, YulLexer __all__ = ['SolidityLexer', 'YulLexer']
84
40
#!/usr/bin/env python3 from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Column, String, Float, DateTime, Integer from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker Base = declarative_base() class Order(Base): __tablename__ = 'orders' id = Column(Intege...
1,174
382
#!/usr/bin/env python ## Program: VMTK ## Module: $RCSfile: vmtkmeshboundaryinspector.py,v $ ## Language: Python ## Date: $Date: 2006/05/26 12:35:13 $ ## Version: $Revision: 1.3 $ ## Copyright (c) Luca Antiga, David Steinman. All rights reserved. ## See LICENSE file for details. ## This softwar...
6,689
2,060
from setuptools import setup from distutils.util import convert_path main_ns = {} ver_path = convert_path('mudslide/version.py') with open(ver_path) as ver_file: exec(ver_file.read(), main_ns) def readme(): with open("README.md") as f: return f.read() setup( name='mudslide', packages=['mudsli...
1,542
494
import csv import joblib from sklearn.metrics import accuracy_score data = [] features = [] targets = [] feature_names = [] users = [] with open('satisfaction_feature_names.csv') as name_file: column_name_file = csv.reader(name_file) feature_names = next(column_name_file)[2:394] with open('cza_satisfaction_tr...
1,361
472
class TestClass: def __init__(self, list, name): self.list = list self.name = name def func1(): print("func1 print something") def func2(): print("func2 print something") integer = 8 return integer def func3(): print("func3 print something") s = "func3" return s def f...
573
189
"""Utilities for managing child processes within a scope - this ensures tests run cleanly even on failure and also gives us a mechanism to get debug info for our children. """ import logging import os import sys from contextlib import contextmanager from typing import ContextManager, List import psutil import process...
2,836
814
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright 2016 Carlos Segura. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LI...
2,516
697
import unittest import pandas as pd import git import os from dfstools import get_dataset_dtypes from dfstools import find_related_cols_by_name from dfstools import find_related_cols_by_content from dfstools import find_parent_child_relationships from dfstools import pecan_cookies_load_data class RelationshipTools(un...
4,087
1,148
import sys from PyQt5.QtWidgets import QApplication, QWidget, QPushButton, QHBoxLayout, QGroupBox, QDialog, QVBoxLayout, QGridLayout,QMainWindow, QApplication, QWidget, QPushButton, QAction, QLineEdit, QMessageBox from PyQt5.QtGui import QIcon from PyQt5.QtCore import pyqtSlot class App(QDialog): def __ini...
2,836
980
# // ########################################################################### # // Queries # // ########################################################################### # -> get a single cell of a df (use `iloc` with `row` + `col` as arguments) df.iloc[0]['staticContextId'] # -> get one column as a list allFunc...
1,446
459
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: v3/diff/UniversalDiff.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflec...
2,279
857
#!/usr/bin/env python # -*- coding: utf-8 -*- """ """ from __future__ import annotations import numpy as np import torch from torch import Tensor from onevision.data.augment.base import BaseAugment from onevision.data.augment.utils import apply_transform_op from onevision.data.data_class import ObjectAnnotation fro...
4,549
1,414
from pudzu.charts import * from pudzu.sandbox.bamboo import * import seaborn as sns # generate map df = pd.read_csv("datasets/euvotes.csv").set_index('country') palette = tmap(RGBA, sns.cubehelix_palette(11, start=0.2, rot=-0.75)) ranges = [20000000,10000000,5000000,2000000,1000000,500000,200000,100000,0] def voteco...
2,087
896
import pandas as pd import numpy as np from copy import * from bisect import * from scipy.optimize import curve_fit from sklearn.metrics import * from collections import defaultdict as defd import datetime,pickle from DemandHelper import * import warnings warnings.filterwarnings("ignore") ####################...
6,264
2,467
import keras from keras.datasets import mnist from keras.models import Sequential from keras.layers import Dense, Flatten from keras.layers import Conv2D, MaxPooling2D model = Sequential() model.add(Conv2D(32, kernel_size=(3, 3), activation='relu', input_shape=(128, 128, 1))) model.ad...
1,088
435
# AUTOGENERATED FILE! PLEASE DON'T EDIT """ This module is for selecting a subnetwork using CSS so that you can do special things to them. Checkout the tutorial section for a walkthrough. This is exposed automatically with:: from k1lib.imports import * selector.select # exposed """ from torch import nn; import k...
15,373
5,049
''' Created on 22 févr. 2022 @author: slinux ''' from .wxRavenGeneralDesign import wxRavenWebBrowser from wxRavenGUI.application.wxcustom.CustomLoading import * from wxRavenGUI.application.wxcustom import * import wx.html2 as webview import sys import logging from wxRavenGUI.application.wxcustom.CustomUserIO import ...
3,482
1,059
# Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). You # may not use this file except in compliance with the License. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file accompa...
4,097
1,175
''' Perimeterator - Enumerator for AWS ELBs (Public IPs). ''' import logging import boto3 from perimeterator.helper import aws_elb_arn from perimeterator.helper import dns_lookup class Enumerator(object): ''' Perimeterator - Enumerator for AWS ELBs (Public IPs). ''' # Required for Boto and reporting. SE...
2,719
699
"""Module to help guess whether a file is binary or text. Requirements: Python 2.7+ Recommended: Python 3 """ def is_binary_file(fname): """Attempt to guess if 'fname' is a binary file heuristically. This algorithm has many flaws. Use with caution. It assumes that if a part of the file has NUL b...
1,685
516
import numpy as np import spikemetrics.metrics as metrics from .utils.thresholdcurator import ThresholdCurator from .quality_metric import QualityMetric import spiketoolkit as st from spikemetrics.utils import Epoch, printProgressBar from collections import OrderedDict from .parameter_dictionaries import get_recording_...
8,329
2,514
# This is a sample Python script. # Press Mayús+F10 to execute it or replace it with your code. # Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings. import Gramatica as g import interprete as Inter import ts as TS import jsonMode as JSON_INGE import jsonMode as json impor...
824
273
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Test spparser.py module, which uses spark.py. .. note:: Only testing to see if the parser makes the right kind of objects. Quality of the data is tested in other modules. """ # STDLIB import os # THIRD-PARTY import pytest from astropy impor...
19,132
7,866
from __future__ import absolute_import import os from tornado.web import StaticFileHandler from rsbroker.views import websocket from rsbroker.views.error import NotFoundErrorHandler settings = dict( template_path=os.path.join(os.path.dirname(__file__), "templates"), static_path=os.path.join(os.path.dirname(...
554
183
# -*- coding: utf-8 -*- """ Unit testing for command flags. This tests the various command flags and there helper methods. """ import argparse import typing import uuid import pytest from pheweb.load.command_flags import ( FLAG_CHROMOSOME, add_chromosome_flag, OUTPUT_COLUMN_CHROMOSOME, FLAG_POSITION...
6,465
2,293
#! /usr/bin/env python # This file is part of khmer, https://github.com/dib-lab/khmer/, and is # Copyright (C) 2011-2015, Michigan State University. # Copyright (C) 2015, The Regents of the University of California. # # Redistribution and use in source and binary forms, with or without # modification, are permitted pro...
4,388
1,446
import json import pathlib from unittest.mock import patch from freezegun import freeze_time from datahub.ingestion.run.pipeline import Pipeline from datahub.ingestion.source.identity.azure_ad import AzureADConfig from tests.test_helpers import mce_helpers FROZEN_TIME = "2021-08-24 09:00:00" def test_azure_ad_conf...
7,745
2,737
from .builder import build_optimizers, MGE_OPTIMIZERS, build_gradmanagers from .default_constructor import DefaultOptimizerConstructor
138
39
def climbingLeaderboard(ranked, player): ranked = sorted(list(set(ranked)), reverse=True) ranks = [] # print(ranked) for i in range(len(player)): bi = 0 bs = len(ranked) - 1 index = 0 while (bi <= bs): mid = (bi+bs) // 2 if (ranked[mid] > player...
561
186
#!/usr/bin/env python3 import unittest from config.parser.parsing import Parser class TestParser(unittest.TestCase): # Create an instance of the Parser class parser_inst = Parser(job_id="NA") # Turn the project logger off during UnitTesting, so the end user is not confused by error messages # (So...
8,352
2,501
## Requires Python v3 and pandas (pip install pandas) ## This script takes the newcastle membership csv and attempts ## to reduce the file size as much as possible through aggregation and lookups ## Two lookup files to provide library names and dates are also created. import csv import os import re from datetime impor...
862
240
"""Interface contract object""" from __future__ import absolute_import import six import sys import logging from contracts.interface import ContractException, ContractNotRespected from .extension import ID from ..declarations import implementer from ..verify import verifyObject from ..interface import InterfaceClass ...
10,535
2,916
import numpy as np import torch import torchvision.transforms as transforms from dataloader.dataloader_hourglass import heatmap_Dataloader import os from network import KFSGNet import torchvision.transforms as transforms os.environ['CUDA_VISIBLE_DEVICES'] = '2' # Device configuration device = torch.device('cuda' if t...
3,979
1,671
#!/usr/bin/env python3 import sys from argparse import ArgumentParser from getpass import getpass from hashlib import pbkdf2_hmac from signal import signal, SIGINT def die(*_, **__): sys.exit() signal = signal(SIGINT, die) iwd = """[Security] PreSharedKey={psk}""" supplicant = """network={{ ssid={ssid} ...
1,648
592
# -*- coding: utf-8 -*- from optparse import make_option from django.conf import settings from django.core.management.base import BaseCommand, CommandError from cms.api import copy_plugins_to_language from cms.models import Title, Page from cms.utils.i18n import get_language_list class CopyLangCommand(BaseCommand)...
2,406
684
# Generated by Django 2.1.2 on 2018-10-14 18:37 from django.db import migrations import picklefield.fields class Migration(migrations.Migration): dependencies = [ ('mainsite', '0014_mlmodel_type_num'), ] operations = [ migrations.AlterField( model_name='mlmodel', ...
424
146
# -*- coding: utf-8 -*- from adsrefpipe.refparsers.CrossRefXML import CrossReftoREFs from adsrefpipe.refparsers.ElsevierXML import ELSEVIERtoREFs from adsrefpipe.refparsers.JATSxml import JATStoREFs from adsrefpipe.refparsers.IOPxml import IOPtoREFs from adsrefpipe.refparsers.SpringerXML import SPRINGERtoREFs from ads...
1,563
564
from cached_property import cached_property from purl import URL from onegov.translator_directory import _ from onegov.core.elements import Block, Link, LinkGroup, Confirm, Intercooler from onegov.core.utils import linkify from onegov.org.layout import DefaultLayout as BaseLayout from onegov.translator_directory.colle...
12,221
3,067
import pandas as pd import numpy as np import io def info(df): print("------------DIMENSIONS------------") print("Rows:", df.shape[0]) print("Columns:", df.shape[1]) print("--------------DTYPES--------------") columns = df.columns.tolist() integers = df.select_dtypes("integer").columns.tolist(...
1,169
371
# Copyright (c) nexB Inc. and others. All rights reserved. # ScanCode 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/scancode-toolkit for support or download. # See https://aboutcode.org for more inf...
5,861
1,784
#!/usr/bin/env python2.7 # # Copyright (c) 2016 ARM Limited # All rights reserved # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementa...
10,268
3,087
from app import ( mythic, links, nginx_port, listen_port, mythic_admin_password, mythic_admin_user, default_operation_name, mythic_db ) import app import asyncpg import redis from peewee_async import Manager from sanic.response import json from sanic import response from ...
19,042
5,499
from ctypes import c_int from .dll import _bind __all__ = [ # Enums "SDL_BlendMode", "SDL_BLENDMODE_NONE", "SDL_BLENDMODE_BLEND", "SDL_BLENDMODE_ADD", "SDL_BLENDMODE_MOD", "SDL_BLENDMODE_MUL", "SDL_BLENDMODE_INVALID", "SDL_BlendOperation", "SDL_BLENDOPERATION_ADD", "SDL_BLENDOPERATION_SUBTRACT...
1,911
1,038
from .vizutils import viz_overlaymask, display_side2side, display_side2sidev1, stack_patches, figure2image, get_heatmap, visualize_probmaps from .vizutils import get_heatmap_multiple, figure2image_save
204
70